summaryrefslogtreecommitdiff
path: root/include/asm-generic/gpio.h
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-02-12 23:56:24 -0600
committerKumar Gala <galak@kernel.crashing.org>2007-02-12 23:56:24 -0600
commitcbe56159a3e60624b5f44cf48b640fa470436e34 (patch)
treef3dd43243be6e840dc2b0386e91c4146a4f51620 /include/asm-generic/gpio.h
parent67c2b7d9d224232ee730b9c9444abed824b62e7a (diff)
parent17e0e27020d028a790d97699aff85a43af5be472 (diff)
Merge branch 'master' into 83xx
Diffstat (limited to 'include/asm-generic/gpio.h')
-rw-r--r--include/asm-generic/gpio.h25
1 files changed, 25 insertions, 0 deletions
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 @@
+#ifndef _ASM_GENERIC_GPIO_H
+#define _ASM_GENERIC_GPIO_H
+
+/* platforms that don't directly support access to GPIOs through I2C, SPI,
+ * or other blocking infrastructure can use these wrappers.
+ */
+
+static inline int gpio_cansleep(unsigned gpio)
+{
+ return 0;
+}
+
+static inline int gpio_get_value_cansleep(unsigned gpio)
+{
+ might_sleep();
+ return gpio_get_value(gpio);
+}
+
+static inline void gpio_set_value_cansleep(unsigned gpio, int value)
+{
+ might_sleep();
+ gpio_set_value(gpio, value);
+}
+
+#endif /* _ASM_GENERIC_GPIO_H */