]> Pileus Git - ~andy/linux/blobdiff - include/linux/gpio.h
gpio: add API to be strict about GPIO IRQ usage
[~andy/linux] / include / linux / gpio.h
index f6c7ae3e223b53914eac6ae4941a977d03597636..a06ec3e85ba36e988214836a4591d780480bec5b 100644 (file)
@@ -39,7 +39,7 @@ struct gpio {
        const char      *label;
 };
 
-#ifdef CONFIG_GENERIC_GPIO
+#ifdef CONFIG_GPIOLIB
 
 #ifdef CONFIG_ARCH_HAVE_CUSTOM_GPIO_H
 #include <asm/gpio.h>
@@ -74,7 +74,7 @@ static inline int irq_to_gpio(unsigned int irq)
 
 #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */
 
-#else /* ! CONFIG_GENERIC_GPIO */
+#else /* ! CONFIG_GPIOLIB */
 
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -204,6 +204,18 @@ static inline int gpio_to_irq(unsigned gpio)
        return -EINVAL;
 }
 
+static inline int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset)
+{
+       WARN_ON(1);
+       return -EINVAL;
+}
+
+static inline void gpio_unlock_as_irq(struct gpio_chip *chip,
+                                     unsigned int offset)
+{
+       WARN_ON(1);
+}
+
 static inline int irq_to_gpio(unsigned irq)
 {
        /* irq can never have been returned from gpio_to_irq() */
@@ -226,7 +238,7 @@ gpiochip_remove_pin_ranges(struct gpio_chip *chip)
        WARN_ON(1);
 }
 
-#endif /* ! CONFIG_GENERIC_GPIO */
+#endif /* ! CONFIG_GPIOLIB */
 
 struct device;