aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/gpio.h7
-rw-r--r--include/asm-generic/gpio.h25
2 files changed, 32 insertions, 0 deletions
diff --git a/include/asm-arm/gpio.h b/include/asm-arm/gpio.h
new file mode 100644
index 000000000000..fff4f800ee42
--- /dev/null
+++ b/include/asm-arm/gpio.h
@@ -0,0 +1,7 @@
1#ifndef _ARCH_ARM_GPIO_H
2#define _ARCH_ARM_GPIO_H
3
4/* not all ARM platforms necessarily support this API ... */
5#include <asm/arch/gpio.h>
6
7#endif /* _ARCH_ARM_GPIO_H */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
new file mode 100644
index 000000000000..2d0aab1d8611
--- /dev/null
+++ b/include/asm-generic/gpio.h
@@ -0,0 +1,25 @@
1#ifndef _ASM_GENERIC_GPIO_H
2#define _ASM_GENERIC_GPIO_H
3
4/* platforms that don't directly support access to GPIOs through I2C, SPI,
5 * or other blocking infrastructure can use these wrappers.
6 */
7
8static inline int gpio_cansleep(unsigned gpio)
9{
10 return 0;
11}
12
13static inline int gpio_get_value_cansleep(unsigned gpio)
14{
15 might_sleep();
16 return gpio_get_value(gpio);
17}
18
19static inline void gpio_set_value_cansleep(unsigned gpio, int value)
20{
21 might_sleep();
22 gpio_set_value(gpio, value);
23}
24
25#endif /* _ASM_GENERIC_GPIO_H */