Skip to contentSkip to conversation

gpio: Add APM X-Gene standy platform GPIO driver

PATCH Superseded Y Vo 2 participants 7 messages Jan 16, 2015 – Jan 20, 2015

Subsystems (3)
lore
Share & tools
lore

Y Vo

author
#0 lore raw

v3 cover gpio: Add APM X-Gene standy platform GPIO driver

This patch add the GPIO standby controller in the APM X-Gene platform.

v3 Change:
1. Using GPIO_GENERIC.

v2 Change:
1. Do not access GIC register from driver.
2. Duplicate gpio probe funtion.
3. Function gpiochip_remove doesn't return value.

Y Vo (3):
gpio: Add APM X-Gene standby GPIO controller driver
Documentation: gpio: Add APM X-Gene standby GPIO controller DTS
binding
arm64: dts: Add APM X-Gene standby GPIO controller DTS entries

 .../devicetree/bindings/gpio/gpio-xgene-sb.txt     |   31 ++++
 arch/arm64/boot/dts/apm/apm-storm.dtsi             |   13 ++
 drivers/gpio/Kconfig                               |    7 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/gpio-xgene-sb.c                       |  163 ++++++++++++++++++++
 5 files changed, 215 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-xgene-sb.txt
 create mode 100644 drivers/gpio/gpio-xgene-sb.c
author
#1 lore raw

PATCH v3 1/3 gpio: Add APM X-Gene standby GPIO controller driver

Driver for standby GPIO controller of APM X-Gene SoCs on arm64.

---
 drivers/gpio/Kconfig         |    8 ++
 drivers/gpio/Makefile        |    1 +
 drivers/gpio/gpio-xgene-sb.c |  162 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/gpio-xgene-sb.c
drivers/gpio/Kconfig +8 -0
index 1eff81c..4fec748 100644
@@ -366,6 +366,14 @@ config GPIO_XGENE
 	  the generic flash controller's address and data pins. Say yes
 	  here to enable the GFC GPIO functionality.
 
+config GPIO_XGENE_SB
+	tristate "APM X-Gene GPIO standby controller support"
+	depends on ARCH_XGENE && OF_GPIO
+	select GPIO_GENERIC
+	help
+	  This driver supports the GPIO block within the APM X-Gene
+	  Standby Domain. Say yes here to enable the GPIO functionality.
+
 config GPIO_XILINX
 	tristate "Xilinx GPIO support"
 	depends on OF_GPIO && (PPC_OF || MICROBLAZE || ARCH_ZYNQ || ARCH_X86)
drivers/gpio/Makefile +1 -0
index 81755f1..3031b19 100644
@@ -105,6 +105,7 @@ obj-$(CONFIG_GPIO_WM831X)	+= gpio-wm831x.o
 obj-$(CONFIG_GPIO_WM8350)	+= gpio-wm8350.o
 obj-$(CONFIG_GPIO_WM8994)	+= gpio-wm8994.o
 obj-$(CONFIG_GPIO_XGENE)	+= gpio-xgene.o
+obj-$(CONFIG_GPIO_XGENE_SB)	+= gpio-xgene-sb.o
 obj-$(CONFIG_GPIO_XILINX)	+= gpio-xilinx.o
 obj-$(CONFIG_GPIO_XTENSA)	+= gpio-xtensa.o
 obj-$(CONFIG_GPIO_ZEVIO)	+= gpio-zevio.o
drivers/gpio/gpio-xgene-sb.c new file +162 -0

162 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

PATCH v3 1/3 gpio: Add APM X-Gene standby GPIO controller driver

Quoted 3 lines · Y Vo

Driver for standby GPIO controller of APM X-Gene SoCs on arm64.

Compact, beautiful, and precisely to the point.
Patch applied, excellent work.

Yours,
Linus Walleij

author
#3 lore raw

PATCH v3 2/3 Documentation: gpio: Add APM X-Gene standby GPIO controller DTS binding

In reply to Y Vo

Documentation for APM X-Gene standby GPIO controller DTS binding.

---
 .../devicetree/bindings/gpio/gpio-xgene-sb.txt     |   31 ++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-xgene-sb.txt
Documentation/devicetree/bindings/gpio/gpio-xgene-sb.txt new file +31 -0
new file mode 100644
index 0000000..3215e4d
@@ -0,0 +1,31 @@
+APM X-Gene Standby GPIO controller bindings
+
+This is a gpio controller in standby domain.
+
+There are 20 GPIO pins from 0..21. There is no GPIO_DS14 and GPIO_DS15. 
+Only GPIO_DS8..GPIO_DS13 support interrupt. IRQ mapping 0x28..0x2d.
+
+Required properties:
+- compatible: "apm,xgene-gpio-sb" for X-Gene Standby GPIO controller
+- reg: Physical base address and size of the controller's registers
+- #gpio-cells: Should be two.
+	- first cell is the pin number
+	- second cell is used to specify the gpio polarity:
+		0 = active high
+		1 = active low
+- gpio-controller: Marks the device node as a GPIO controller.
+- interrupts: Shall contains the interrupts.
+
+Example:
+	sbgpio: sbgpio at 17001000 {
+		compatible = "apm,xgene-gpio-sb";
+		reg = <0x0 0x17001000 0x0 0x400>;
+		#gpio-cells = <2>;
+		gpio-controller;
+		interrupts = 	<0x0 0x28 0x1>,
+				<0x0 0x29 0x1>,
+				<0x0 0x2a 0x1>,
+				<0x0 0x2b 0x1>,
+				<0x0 0x2c 0x1>,
+				<0x0 0x2d 0x1>;
+	};
Signature · 1 line
1.7.1
#4 lore raw

PATCH v3 2/3 Documentation: gpio: Add APM X-Gene standby GPIO controller DTS binding

Quoted 3 lines · Y Vo

Documentation for APM X-Gene standby GPIO controller DTS binding.

Patch applied after some tweaks.

Yours,
Linus Walleij

author
#5 lore raw

PATCH v3 3/3 arm64: dts: Add APM X-Gene standby GPIO controller DTS entries

In reply to Y Vo

Add standby domain gpio controller for APM X-Gene SoC platform.

---
 arch/arm64/boot/dts/apm/apm-storm.dtsi |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
arch/arm64/boot/dts/apm/apm-storm.dtsi +13 -0
index f1ad9c2..2e1c438 100644
@@ -587,6 +587,19 @@
 			phy-names = "sata-phy";
 		};
 
+		sbgpio: sbgpio at 17001000{
+			compatible = "apm,xgene-gpio-sb";
+			reg = <0x0 0x17001000 0x0 0x400>;
+			#gpio-cells = <2>;
+			gpio-controller;
+			interrupts = 	<0x0 0x28 0x1>,
+					<0x0 0x29 0x1>,
+					<0x0 0x2a 0x1>,
+					<0x0 0x2b 0x1>,
+					<0x0 0x2c 0x1>,
+					<0x0 0x2d 0x1>;
+		};
+
 		rtc: rtc at 10510000 {
 			compatible = "apm,xgene-rtc";
 			reg = <0x0 0x10510000 0x0 0x400>;
Signature · 1 line
1.7.1