Skip to contentSkip to conversation

powerpc: add driver for simple GPIO banks

PATCH New Anton Vorontsov 1 participant 1 message Sep 4, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 powerpc: add driver for simple GPIO 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.

---

The driver is user-selectable now.

 arch/powerpc/sysdev/Kconfig          |   11 +++
 arch/powerpc/sysdev/Makefile         |    2 +
 arch/powerpc/sysdev/of_simple_gpio.c |  154 ++++++++++++++++++++++++++++++++++
 3 files changed, 167 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/sysdev/of_simple_gpio.c
arch/powerpc/sysdev/Kconfig +11 -0
index 72fb35b..30d6e4d 100644
@@ -6,3 +6,14 @@ config PPC4xx_PCI_EXPRESS
 	bool
 	depends on PCI && 4xx
 	default n
+
+config OF_SIMPLE_GPIO
+	bool "Support for simple, memory-mapped GPIO controllers"
+	depends on PPC
+	select GENERIC_GPIO
+	select ARCH_REQUIRE_GPIOLIB
+	help
+	  Say Y here to support simple, memory-mapped GPIO controllers.
+	  These are usually BCSRs used to control board's switches, LEDs,
+	  chip-selects, Ethernet/USB PHY's power and various other small
+	  on-board peripherals.
arch/powerpc/sysdev/Makefile +2 -0
index a90054b..239d7e8 100644
@@ -36,6 +36,8 @@ ifeq ($(CONFIG_PCI),y)
 obj-$(CONFIG_4xx)		+= ppc4xx_pci.o
 endif
 
+obj-$(CONFIG_OF_SIMPLE_GPIO)	+= of_simple_gpio.o
+
 # Temporary hack until we have migrated to asm-powerpc
 ifeq ($(ARCH),powerpc)
 obj-$(CONFIG_CPM)		+= cpm_common.o
arch/powerpc/sysdev/of_simple_gpio.c new file +154 -0

154 lines not on this page · raw message

Signature · 1 line
1.5.6.3