summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-08-06 12:57:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-08-20 07:47:11 +0200
commit0d14bc0ec4f8017e49ab5d2d91c45f5957afc31d (patch)
tree30b1d3e1b3eab5d735872c40c488036cb97fb184 /include
parent85008e55422ff7576a251c2214c7d32ad8aab600 (diff)
downloadbarebox-0d14bc0ec4f8017e49ab5d2d91c45f5957afc31d.tar.gz
barebox-0d14bc0ec4f8017e49ab5d2d91c45f5957afc31d.tar.xz
gpio: Drop asm-generic/gpio.h
Since we no longer have custom gpio function prototypes we can drop the prototypes from asm-generic/gpio.h can add them to include/gpio.h instead. While at it add static inline dummy wrappers for !CONFIG_GENERIC_GPIO so that code using gpios can compile without gpio support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h9
-rw-r--r--include/gpio.h23
2 files changed, 22 insertions, 10 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
deleted file mode 100644
index 767497096a..0000000000
--- a/include/asm-generic/gpio.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_GENERIC_GPIO_H
-#define __ASM_GENERIC_GPIO_H
-
-void gpio_set_value(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_direction_input(unsigned gpio);
-
-#endif /* __ASM_GENERIC_GPIO_H */
diff --git a/include/gpio.h b/include/gpio.h
index f116ea6af7..7b3f512b19 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -1,7 +1,28 @@
#ifndef __GPIO_H
#define __GPIO_H
-#include <asm/gpio.h>
+#ifdef CONFIG_GENERIC_GPIO
+void gpio_set_value(unsigned gpio, int value);
+int gpio_get_value(unsigned gpio);
+int gpio_direction_output(unsigned gpio, int value);
+int gpio_direction_input(unsigned gpio);
+#else
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+}
+static inline int gpio_get_value(unsigned gpio)
+{
+ return 0;
+}
+static inline int gpio_direction_output(unsigned gpio, int value)
+{
+ return -EINVAL;
+}
+static inline int gpio_direction_input(unsigned gpio)
+{
+ return -EINVAL;
+}
+#endif
#define ARCH_NR_GPIOS 256