x86: initial changes to unify traps_32.c and traps_64.c
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / linux / gpio.h
blob98be6c5762b923fcb2a98ced684051c3ea7f773c
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_to_irq(unsigned gpio)
84 /* GPIO can never have been requested or set as input */
85 WARN_ON(1);
86 return -EINVAL;
89 static inline int irq_to_gpio(unsigned irq)
91 /* irq can never have been returned from gpio_to_irq() */
92 WARN_ON(1);
93 return -EINVAL;
96 #endif
98 #endif /* __LINUX_GPIO_H */