Skip to contentSkip to conversation

TI DA850/OMAP-L138/AM18x pinconf

PATCH In review David Lechner 3 participants 8 messages Nov 28, 2016 – Dec 1, 2016

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

v2 cover TI DA850/OMAP-L138/AM18x pinconf

This series adds a new driver and DT bindings for TI DA850/OMAP-L138/AM18x pinconf (bias pullup/pulldown).

The motivation for this series is LEGO MINDSTORMS EV3 support. It needs most, if not all, internal pullup/down resistors disabled in order to work correctly.

v2 changes:
* s/DA8XX/DA850/ in the commit messages
* Fix get_get typo in pinctrl-da850-pupd.c
* Moved pin-controller at 22c00c device node in da850.dtsi

David Lechner (3):
devicetree: bindings: pinctrl: Add binding for ti,da850-pupd
pinctrl: New driver for TI DA850/OMAP-L138/AM18XX pinconf
ARM: dts: da850: Add node for pullup/pulldown pinconf

 .../devicetree/bindings/pinctrl/ti,da850-pupd.txt  |  55 ++++++
 arch/arm/boot/dts/da850.dtsi                       |   5 +
 drivers/pinctrl/Kconfig                            |   9 +
 drivers/pinctrl/Makefile                           |   1 +
 drivers/pinctrl/pinctrl-da850-pupd.c               | 210 +++++++++++++++++++++
 5 files changed, 280 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.txt
 create mode 100644 drivers/pinctrl/pinctrl-da850-pupd.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/3 devicetree: bindings: pinctrl: Add binding for ti,da850-pupd

Device-tree bindings for TI DA850/OMAP-L138/AM18XX pullup/pulldown pinconf controller.

---

v2 changes:
* s/DA8XX/DA850/ in the commit message

 .../devicetree/bindings/pinctrl/ti,da850-pupd.txt  | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.txt
Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.txt new file +55 -0
new file mode 100644
index 0000000..7f29805
@@ -0,0 +1,55 @@
+* Pin configuration for TI DA850/OMAP-L138/AM18x
+
+These SoCs have a separate controller for setting bias (internal pullup/down).
+Bias can only be selected for groups rather than individual pins.
+
+Required Properties:
+
+  - compatible: Must be "ti,da850-pupd"
+  - reg: Base address and length of the memory resource used by the pullup/down
+    controller hardware module.
+
+The controller node also acts as a container for pin group configuration nodes.
+The names of these groups are ignored.
+
+Pin Group Node Properties:
+
+- groups: An array of strings, each string containing the name of a pin group.
+          Valid names are "cp0".."cp31".
+
+The pin configuration parameters use the generic pinconf bindings defined in
+pinctrl-bindings.txt in this directory. The supported parameters are
+bias-disable, bias-pull-up, bias-pull-down.
+
+
+Example
+-------
+
+In common dtsi file:
+
+	pinconf: pin-controller at 22c00c {
+		compatible = "ti,da850-pupd";
+		reg = <0x22c00c 0x8>;
+	};
+
+In board-specific file:
+
+	&pinconf {
+		pinctrl-0 = <&pinconf_bias_groups>;
+		pinctrl-names = "default";
+
+		pinconf_bias_groups: bias-groups {
+			pull-up {
+				groups = "cp30", "cp31";
+				bias-pull-up;
+			};
+			pull-down {
+				groups = "cp29", "cp28";
+				bias-pull-down;
+			};
+			disable {
+				groups = "cp27", "cp26";
+				bias-disable;
+			};
+		};
+	};
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 2/3 pinctrl: New driver for TI DA850/OMAP-L138/AM18XX pinconf

In reply to David Lechner

This adds a new driver for pinconf on TI DA850/OMAP-L138/AM18XX. These SoCs have a separate controller for controlling pullup/pulldown groups.

---

v2 changes:
* s/DA8XX/DA850/ in the commit messages
* Fix get_get typo in two function names

 drivers/pinctrl/Kconfig              |   9 ++
 drivers/pinctrl/Makefile             |   1 +
 drivers/pinctrl/pinctrl-da850-pupd.c | 210 +++++++++++++++++++++++++++++++++++
 3 files changed, 220 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-da850-pupd.c
drivers/pinctrl/Kconfig +9 -0
index 5f40ad6..54044a8 100644
@@ -93,6 +93,15 @@ config PINCTRL_AMD
 	  Requires ACPI/FDT device enumeration code to set up a platform
 	  device.
 
+config PINCTRL_DA850_PUPD
+	tristate "TI DA850/OMAP-L138/AM18XX pullup/pulldown groups"
+	depends on OF && (ARCH_DAVINCI_DA850 || COMPILE_TEST)
+	select PINCONF
+	select GENERIC_PINCONF
+	help
+	  Driver for TI DA850/OMAP-L138/AM18XX pinconf. Used to control
+	  pullup/pulldown pin groups.
+
 config PINCTRL_DIGICOLOR
 	bool
 	depends on OF && (ARCH_DIGICOLOR || COMPILE_TEST)
drivers/pinctrl/Makefile +1 -0
index 3b8e6f7..25d50a8 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_PINCTRL_BF60x)	+= pinctrl-adi2-bf60x.o
 obj-$(CONFIG_PINCTRL_AT91)	+= pinctrl-at91.o
 obj-$(CONFIG_PINCTRL_AT91PIO4)	+= pinctrl-at91-pio4.o
 obj-$(CONFIG_PINCTRL_AMD)	+= pinctrl-amd.o
+obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o
 obj-$(CONFIG_PINCTRL_DIGICOLOR)	+= pinctrl-digicolor.o
 obj-$(CONFIG_PINCTRL_FALCON)	+= pinctrl-falcon.o
 obj-$(CONFIG_PINCTRL_MAX77620)	+= pinctrl-max77620.o
drivers/pinctrl/pinctrl-da850-pupd.c new file +210 -0

210 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 3/3 ARM: dts: da850: Add node for pullup/pulldown pinconf

In reply to David Lechner

This SoC has a separate pin controller for configuring pullup/pulldown bias on groups of pins.

---

v2 changes:
* Moved pin-controller at 22c00c device node after gpio at 226000 (there seem to be more nodes in proper order here compared to the i2c at 228000 node suggested by Sekhar)

 arch/arm/boot/dts/da850.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/da850.dtsi +5 -0
index 8945815..7a8d38e 100644
@@ -442,6 +442,11 @@
 			ti,davinci-gpio-unbanked = <0>;
 			status = "disabled";
 		};
+		pinconf: pin-controller at 22c00c {
+			compatible = "ti,da850-pupd";
+			reg = <0x22c00c 0x8>;
+			status = "disabled";
+		};
 
 		mcasp0: mcasp at 100000 {
 			compatible = "ti,da830-mcasp-audio";
Signature · 1 line
2.7.4
Acked-by on v2 3/3
#6 lore raw

Re: [PATCH v2 3/3] ARM: dts: da850: Add node for pullup/pulldown pinconf

In reply to David Lechner
Quoted 10 lines · David Lechner

This SoC has a separate pin controller for configuring pullup/pulldown bias on groups of pins.

---

v2 changes:
* Moved pin-controller at 22c00c device node after gpio at 226000 (there seem to be more nodes in proper order here compared to the i2c at 228000 node suggested by Sekhar)

Take this through the ARM SoC tree.

Yours,
Linus Walleij

#7 lore raw

Re: [PATCH v2 3/3] ARM: dts: da850: Add node for pullup/pulldown pinconf

Quoted 8 lines · Linus Walleij
Quoted 6 lines · David Lechner

This SoC has a separate pin controller for configuring pullup/pulldown bias on groups of pins.

---

Quoted 8 lines
Quoted 4 lines

v2 changes:
* Moved pin-controller at 22c00c device node after gpio at 226000 (there seem to be more nodes in proper order here compared to the i2c at 228000 node suggested by Sekhar)

Take this through the ARM SoC tree.

Thanks Linus! Applied to v4.10/dt

Thanks,
Sekhar