Skip to contentSkip to conversation

gpio: Driver for SYSCON-based GPIOs

PATCH In review Alexander Shiyan 2 participants 2 messages Mar 11, 2014 – Mar 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 gpio: Driver for SYSCON-based GPIOs

SYSCON driver was designed for using memory areas (registers) that are used in several subsystems. There are systems (CPUs) which use bits in one register for various purposes and thus should be handled by various kernel subsystems. This driver allows you to use the individual SYSCON bits as GPIOs. ARM CLPS711X SYSFLG1 input lines has been added as first user of this driver.

---
 .../bindings/gpio/cirrus,clps711x-mctrl-gpio.txt   |  17 ++
 drivers/gpio/Kconfig                               |   6 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-syscon.c                         | 191 +++++++++++++++++++++
 4 files changed, 215 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/cirrus,clps711x-mctrl-gpio.txt
 create mode 100644 drivers/gpio/gpio-syscon.c
Documentation/devicetree/bindings/gpio/cirrus,clps711x-mctrl-gpio.txt new file +17 -0
new file mode 100644
index 0000000..94ae9f8
@@ -0,0 +1,17 @@
+* ARM Cirrus Logic CLPS711X SYSFLG1 MCTRL GPIOs
+
+Required properties:
+- compatible: Should contain "cirrus,clps711x-mctrl-gpio".
+- gpio-controller: Marks the device node as a gpio controller.
+- #gpio-cells: Should be two. The first cell is the pin number and
+  the second cell is used to specify the gpio polarity:
+    0 = Active high,
+    1 = Active low.
+
+Example:
+	sysgpio: sysgpio {
+		compatible = "cirrus,ep7312-mctrl-gpio",
+			     "cirrus,clps711x-mctrl-gpio";
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
drivers/gpio/Kconfig +6 -0
index d71d3f8..45f14a76 100644
@@ -290,6 +290,12 @@ config GPIO_STA2X11
 	  Say yes here to support the STA2x11/ConneXt GPIO device.
 	  The GPIO module has 128 GPIO pins with alternate functions.
 
+config GPIO_SYSCON
+	tristate "GPIO based on SYSCON"
+	depends on MFD_SYSCON && OF
+	help
+	  Say yes here to support GPIO functionality though SYSCON driver.
+
 config GPIO_TS5500
 	tristate "TS-5500 DIO blocks and compatibles"
 	depends on TS5500 || COMPILE_TEST
drivers/gpio/Makefile +1 -0
index aaff7ff..6309aff 100644
@@ -77,6 +77,7 @@ obj-$(CONFIG_GPIO_STA2X11)	+= gpio-sta2x11.o
 obj-$(CONFIG_GPIO_STMPE)	+= gpio-stmpe.o
 obj-$(CONFIG_GPIO_STP_XWAY)	+= gpio-stp-xway.o
 obj-$(CONFIG_GPIO_SX150X)	+= gpio-sx150x.o
+obj-$(CONFIG_GPIO_SYSCON)	+= gpio-syscon.o
 obj-$(CONFIG_GPIO_TB10X)	+= gpio-tb10x.o
 obj-$(CONFIG_GPIO_TC3589X)	+= gpio-tc3589x.o
 obj-$(CONFIG_ARCH_TEGRA)	+= gpio-tegra.o
drivers/gpio/gpio-syscon.c new file +191 -0

191 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 9 lines · Alexander Shiyan

SYSCON driver was designed for using memory areas (registers) that are used in several subsystems. There are systems (CPUs) which use bits in one register for various purposes and thus should be handled by various kernel subsystems. This driver allows you to use the individual SYSCON bits as GPIOs. ARM CLPS711X SYSFLG1 input lines has been added as first user of this driver.

I am happy with this driver, patch applied. Unless someone goes protesting.

Thanks for your patience Alexander, it's always tricky with these new things.

Yours,
Linus Walleij