summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/simple_gpio.h
diff options
context:
space:
mode:
authorAnton Vorontsov2008-12-18 17:37:26 +0100
committerKumar Gala2008-12-30 18:13:45 +0100
commit3d64de9c50619d32eb71d993d23a50b98d12d3c0 (patch)
treec6477e8309eaddf30c64619794e1f44775cd7352 /arch/powerpc/sysdev/simple_gpio.h
parentpowerpc: Add device tree bindings for BCSR GPIO banks (diff)
downloadkernel-qcow2-linux-3d64de9c50619d32eb71d993d23a50b98d12d3c0.tar.gz
kernel-qcow2-linux-3d64de9c50619d32eb71d993d23a50b98d12d3c0.tar.xz
kernel-qcow2-linux-3d64de9c50619d32eb71d993d23a50b98d12d3c0.zip
powerpc: Implement GPIO driver for simple memory-mapped banks
The driver supports very simple GPIO controllers, that is, when a controller provides just a 'data' register. Such controllers may be found in various BCSRs (Board's FPGAs used to control board's switches, LEDs, chip-selects, Ethernet/USB PHY power, etc). So far we support only 1-byte GPIO banks. Support for other widths may be implemented when/if needed. p.s. To avoid "made up" compatible entries (like compatible = "simple-gpio"), boards must call simple_gpiochip_init() to pass the compatible string. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/simple_gpio.h')
-rw-r--r--arch/powerpc/sysdev/simple_gpio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/simple_gpio.h b/arch/powerpc/sysdev/simple_gpio.h
new file mode 100644
index 000000000000..3a7b0c513c76
--- /dev/null
+++ b/arch/powerpc/sysdev/simple_gpio.h
@@ -0,0 +1,12 @@
+#ifndef __SYSDEV_SIMPLE_GPIO_H
+#define __SYSDEV_SIMPLE_GPIO_H
+
+#include <linux/errno.h>
+
+#ifdef CONFIG_SIMPLE_GPIO
+extern void simple_gpiochip_init(const char *compatible);
+#else
+static inline void simple_gpiochip_init(const char *compatible) {}
+#endif /* CONFIG_SIMPLE_GPIO */
+
+#endif /* __SYSDEV_SIMPLE_GPIO_H */