Skip to contentSkip to conversation

gpio: driver for PrimeCell PL061 GPIO controller

PATCH Superseded Baruch Siach 2 participants 4 messages Jun 1, 2009 GPIO

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gpio: driver for PrimeCell PL061 GPIO controller

This is a driver for the ARM PrimeCell PL061 GPIO AMBA peripheral. The driver is implemented using the gpiolib framework.

This driver also includes support for the use of the PL061 as an interrupt controller (secondary).

---
Changes in v2:
- Address Andrew Morton's comments
- Pass checkpatch.pl
- Add changelog comment

 drivers/gpio/Kconfig       |    5 +
 drivers/gpio/Makefile      |    1 +
 drivers/gpio/pl061.c       |  336 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/gpio/pl061.h |   18 +++
 4 files changed, 360 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/pl061.c
 create mode 100644 include/linux/gpio/pl061.h
drivers/gpio/Kconfig +5 -0
index edb0253..30d7948 100644
@@ -67,6 +67,11 @@ config GPIO_SYSFS
 
 comment "Memory mapped GPIO expanders:"
 
+config GPIO_PL061
+	bool "PrimeCell PL061 GPIO support"
+	help
+	  Say yes here to support the PrimeCell PL061 GPIO device
+
 config GPIO_XILINX
 	bool "Xilinx GPIO support"
 	depends on PPC_OF
drivers/gpio/Makefile +1 -0
index 49ac64e..ef90203 100644
@@ -9,6 +9,7 @@ obj-$(CONFIG_GPIO_MAX732X)	+= max732x.o
 obj-$(CONFIG_GPIO_MCP23S08)	+= mcp23s08.o
 obj-$(CONFIG_GPIO_PCA953X)	+= pca953x.o
 obj-$(CONFIG_GPIO_PCF857X)	+= pcf857x.o
+obj-$(CONFIG_GPIO_PL061)	+= pl061.o
 obj-$(CONFIG_GPIO_TWL4030)	+= twl4030-gpio.o
 obj-$(CONFIG_GPIO_XILINX)	+= xilinx_gpio.o
 obj-$(CONFIG_GPIO_BT8XX)	+= bt8xxgpio.o
drivers/gpio/pl061.c new file +336 -0

336 lines not on this page · raw message

include/linux/gpio/pl061.h new file +18 -0
new file mode 100644
index 0000000..9e18fa3
@@ -0,0 +1,18 @@
+/* platform data for the PL061 GPIO driver */
+
+#define GPIODIR 0x400
+#define GPIOIS  0x404
+#define GPIOIBE 0x408
+#define GPIOIEV 0x40C
+#define GPIOIE  0x410
+#define GPIORIS 0x414
+#define GPIOMIS 0x418
+#define GPIOIC  0x41C
+
+struct pl061_platform_data {
+	/* number of the first GPIO */
+	unsigned	gpio_base;
+	u32		(*pending_irqs)(int irq);
+	u8		directions;	/* startup directions, 1: out, 0: in */
+	u8		values;		/* startup values */
+};
Signature · 1 line
1.6.3.1
#1 lore raw
Quoted 2 lines · Baruch Siach

This is a driver for the ARM PrimeCell PL061 GPIO AMBA peripheral. The driver is implemented using the gpiolib framework.

Why is this a platform driver rather than an AMBA primecell driver?

There are platforms today which provide the PL061 as an amba primecell device.

#2 lore raw

Hi Russell,

Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Baruch Siach

This is a driver for the ARM PrimeCell PL061 GPIO AMBA peripheral. The driver is implemented using the gpiolib framework.

Why is this a platform driver rather than an AMBA primecell driver?

I'm willing to make this driver an AMBA driver. I'd just like to know what is the advantage of the AMBA bus (linux/amba/bus.h) over the platform "bus", from software point of view?

baruch

Signature · 3 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -
#3 lore raw
Quoted 4 lines · Baruch Siach

Hi Russell,

Quoted 1 line · Russell King - ARM Linux

On Mon, Jun 01, 2009 at 12:00:36PM +0300, Baruch Siach wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This is a driver for the ARM PrimeCell PL061 GPIO AMBA peripheral. The driver is implemented using the gpiolib framework.

Why is this a platform driver rather than an AMBA primecell driver?

I'm willing to make this driver an AMBA driver. I'd just like to know what is the advantage of the AMBA bus (linux/amba/bus.h) over the platform "bus", from software point of view?

The amba bus is the established bus for amba primecells. I repeat:
please make it an amba bus driver.