V4L/DVB (8930): gspca: The image transfer by bulk is started by the subdrivers.
[zen-stable.git] / include / linux / gpio.h
blob730a20b83576b4ab39d81810085c20d61eec0225
1 #ifndef __LINUX_GPIO_H
2 #define __LINUX_GPIO_H
4 /* see Documentation/gpio.txt */
6 #ifdef CONFIG_GENERIC_GPIO
7 #include <asm/gpio.h>
9 #else
11 #include <linux/types.h>
12 #include <linux/errno.h>
15 * Some platforms don't support the GPIO programming interface.
17 * In case some driver uses it anyway (it should normally have
18 * depended on GENERIC_GPIO), these routines help the compiler
19 * optimize out much GPIO-related code ... or trigger a runtime
20 * warning when something is wrongly called.
23 static inline int gpio_is_valid(int number)
25 return 0;
28 static inline int gpio_request(unsigned gpio, const char *label)
30 return -ENOSYS;
33 static inline void gpio_free(unsigned gpio)
35 /* GPIO can never have been requested */
36 WARN_ON(1);
39 static inline int gpio_direction_input(unsigned gpio)
41 return -ENOSYS;
44 static inline int gpio_direction_output(unsigned gpio, int value)
46 return -ENOSYS;
49 static inline int gpio_get_value(unsigned gpio)
51 /* GPIO can never have been requested or set as {in,out}put */
52 WARN_ON(1);
53 return 0;
56 static inline void gpio_set_value(unsigned gpio, int value)
58 /* GPIO can never have been requested or set as output */
59 WARN_ON(1);
62 static inline int gpio_cansleep(unsigned gpio)
64 /* GPIO can never have been requested or set as {in,out}put */
65 WARN_ON(1);
66 return 0;
69 static inline int gpio_get_value_cansleep(unsigned gpio)
71 /* GPIO can never have been requested or set as {in,out}put */
72 WARN_ON(1);
73 return 0;
76 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
78 /* GPIO can never have been requested or set as output */
79 WARN_ON(1);
82 static inline int gpio_export(unsigned gpio, bool direction_may_change)
84 /* GPIO can never have been requested or set as {in,out}put */
85 WARN_ON(1);
86 return -EINVAL;
89 static inline void gpio_unexport(unsigned gpio)
91 /* GPIO can never have been exported */
92 WARN_ON(1);
95 static inline int gpio_to_irq(unsigned gpio)
97 /* GPIO can never have been requested or set as input */
98 WARN_ON(1);
99 return -EINVAL;
102 static inline int irq_to_gpio(unsigned irq)
104 /* irq can never have been returned from gpio_to_irq() */
105 WARN_ON(1);
106 return -EINVAL;
109 #endif
111 #endif /* __LINUX_GPIO_H */