Skip to contentSkip to conversation

gpio: Driver for SYSCON-based GPIOs

PATCH Superseded Alexander Shiyan 1 participant 2 messages Jan 11, 2014 – Jan 13, 2014 1 message not in the archive

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 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.

---
 .../devicetree/bindings/gpio/gpio-syscon.txt       |  19 +++
 drivers/gpio/Kconfig                               |   6 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-syscon.c                         | 186 +++++++++++++++++++++
 4 files changed, 212 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-syscon.txt
 create mode 100644 drivers/gpio/gpio-syscon.c
Documentation/devicetree/bindings/gpio/gpio-syscon.txt new file +19 -0
new file mode 100644
index 0000000..47c4fda
@@ -0,0 +1,19 @@
+* SYSCON-based GPIO driver
+
+Required properties:
+- compatible: Should contain one of the following:
+  - "clps711x,syscon-gpio-mctrl": For ARM CLPS711X SYSFLG1 MCTRL GPIOs.
+- syscon: phandle to syscon device node.
+- 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 = "clps711x,syscon-gpio-mctrl";
+		syscon = <&syscon1>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
drivers/gpio/Kconfig +6 -0
index 8c0df49..1f34bdc 100644
@@ -275,6 +275,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"
 	help
drivers/gpio/Makefile +1 -0
index 5d50179..8ae6d47 100644
@@ -76,6 +76,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 +186 -0

186 lines not on this page · raw message

Signature · 6 lines
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive

0KHRg9Cx0LHQvtGC0LAsIDExINGP0L3QstCw0YDRjyAyMDE0LCAxMDoyMyArMDQ6MDAg0L7RgiBB bGV4YW5kZXIgU2hpeWFuIDxzaGNfd29ya0BtYWlsLnJ1PjoKPiBTWVNDT04gZHJpdmVyIHdhcyBk ZXNpZ25lZCBmb3IgdXNpbmcgbWVtb3J5IGFyZWFzIChyZWdpc3RlcnMpCj4gdGhhdCBhcmUgdXNl ZCBpbiBzZXZlcmFsIHN1YnN5c3RlbXMuIFRoZXJlIGFyZSBzeXN0ZW1zIChDUFVzKQo+IHdoaWNo IHVzZSBiaXRzIGluIG9uZSByZWdpc3RlciBmb3IgdmFyaW91cyBwdXJwb3NlcyBhbmQgdGh1cwo+ IHNob3VsZCBiZSBoYW5kbGVkIGJ5IHZhcmlvdXMga2VybmVsIHN1YnN5c3RlbXMuIFRoaXMgZHJp dmVyCj4gYWxsb3dzIHlvdSB0byB1c2UgdGhlIGluZGl2aWR1YWwgU1lTQ09OIGJpdHMgYXMgR1BJ T3MuCj4gQVJNIENMUFM3MTFYIFNZU0ZMRzEgaW5wdXQgbGluZXMgaGFzIGJlZW4gYWRkZWQgYXMg Zmlyc3QgdXNlcgo+IG9mIHRoaXMgZHJpdmVyLgo+IAo+IFNpZ25lZC1vZmYtYnk6IEFsZXhhbmRl ciBTaGl5YW4gPHNoY193b3JrQG1haWwucnU+CgpJIGZvdW5kIHNvbWUgaW5jb3JyZWN0IHRoaW5n cyBpbiB0aGlzIHZlcnNpb24sIHNvIHBsZWFzZSBub3QgcmV2aWV3IHRoaXMKcGF0Y2ggdW50aWwg SSdsbCBzZW5kIHY0LgpUaGFua3MuCgotLS0K
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html