Skip to contentSkip to conversation

TI DA850/OMAP-L138/AM18x pinconf

PATCH Superseded David Lechner 5 participants 15 messages Nov 23, 2016 – Nov 28, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

David Lechner (3):
devicetree: bindings: pinctrl: Add binding for ti,da850-pupd
pinctrl: New driver for TI DA8XX/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 1/3 devicetree: bindings: pinctrl: Add binding for ti,da850-pupd

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

---
 .../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
#5 lore raw

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

In reply to David Lechner

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

---
 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
#9 lore raw

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

---
 arch/arm/boot/dts/da850.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/da850.dtsi +5 -0
index 8945815..1c0224c 100644
@@ -210,6 +210,11 @@
 			};
 
 		};
+		pinconf: pin-controller at 22c00c {
+			compatible = "ti,da850-pupd";
+			reg = <0x22c00c 0x8>;
+			status = "disabled";
+		};
 		prictrl: priority-controller at 14110 {
 			compatible = "ti,da850-mstpri";
 			reg = <0x14110 0x0c>;
Signature · 1 line
2.7.4
#2 lore raw

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

In reply to David Lechner
Quoted 1 line · David Lechner

Device-tree bindings for TI DA8XX/OMAP-L138/AM18XX pullup/pulldown

s/DA8XX/DA850. It looks like this support is absent from DA830.

Quoted 3 lines

pinconf controller.

Thanks,
Sekhar

#6 lore raw

Re: [PATCH 2/3] pinctrl: New driver for TI DA8XX/OMAP-L138/AM18XX pinconf

In reply to David Lechner
Quoted 1 line · David Lechner

This adds a new driver for pinconf on TI DA8XX/OMAP-L138/AM18XX. These

s/DA8XX/DA850/

Quoted 9 lines

SoCs have a separate controller for controlling pullup/pulldown groups.

drivers/pinctrl/pinctrl-da850-pupd.c new file +5 -0
+static const char *da850_pupd_get_get_group_name(struct pinctrl_dev *pctldev,
+						 unsigned int selector)
+{
+	return da850_pupd_group_names[selector];
+}

drivers/pinctrl/pinctrl-da850-pupd.c line 62

Quoted 10 lines
drivers/pinctrl/pinctrl-da850-pupd.c new file +10 -0
+
+static int da850_pupd_get_get_group_pins(struct pinctrl_dev *pctldev,
+					 unsigned int selector,
+					 const unsigned int **pins,
+					 unsigned int *num_pins)
+{
+	*num_pins = 0;
+
+	return 0;
+}

usage of get_get_ in the function names above is odd.

Thanks,
Sekhar

#10 lore raw

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

In reply to David Lechner
Quoted 13 lines · David Lechner

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

---
 arch/arm/boot/dts/da850.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/da850.dtsi +0 -0
index 8945815..1c0224c 100644

arch/arm/boot/dts/da850.dtsi line 217

Quoted 8 lines
arch/arm/boot/dts/da850.dtsi +5 -0
@@ -210,6 +210,11 @@
 			};
 
 		};
+		pinconf: pin-controller at 22c00c {
+			compatible = "ti,da850-pupd";
+			reg = <0x22c00c 0x8>;
+			status = "disabled";
+		};

Can you please place this below the i2c1 node. I am trying to keep the nodes sorted by unit address. I know thats broken in many places today, but lets add the new ones where they should eventually end up.

Thanks,
Sekhar

Reviewed-by on the v1 series
#14 lore raw
In reply to David Lechner
Quoted 5 lines · David Lechner

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.

This looks really neat to my non-pinconf trained eyes. I have sent some minor comments. But apart from that:

3/3 should go through my tree. If the driver patches are going to get queued for v4.10, I can queue the DTS portion through my tree.

Thanks,
Sekhar

#7 lore raw

Re: [PATCH 2/3] pinctrl: New driver for TI DA8XX/OMAP-L138/AM18XX pinconf

In reply to Sekhar Nori
Quoted 18 lines · Sekhar Nori
Quoted 1 line · David Lechner

This adds a new driver for pinconf on TI DA8XX/OMAP-L138/AM18XX. These

s/DA8XX/DA850/

Quoted 13 lines

SoCs have a separate controller for controlling pullup/pulldown groups.

drivers/pinctrl/pinctrl-da850-pupd.c new file +9 -0
+static const char *da850_pupd_get_get_group_name(struct pinctrl_dev *pctldev,
+						 unsigned int selector)
+{
+	return da850_pupd_group_names[selector];
+}
+
+static int da850_pupd_get_get_group_pins(struct pinctrl_dev *pctldev,
+					 unsigned int selector,
+					 const unsigned int **pins,
Quoted 8 lines

drivers/pinctrl/pinctrl-da850-pupd.c line 62

Quoted 6 lines
drivers/pinctrl/pinctrl-da850-pupd.c new file +6 -0
+					 unsigned int *num_pins)
+{
+	*num_pins = 0;
+
+	return 0;
+}

usage of get_get_ in the function names above is odd.

Will fix (copy/paste error)

Quoted 4 lines

Thanks,
Sekhar

#11 lore raw

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

In reply to Sekhar Nori
Quoted 16 lines · Sekhar Nori
Quoted 15 lines · David Lechner

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

---
 arch/arm/boot/dts/da850.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/da850.dtsi +0 -0
index 8945815..1c0224c 100644
@@ -210,6 +210,11 @@
 			};
 
Quoted 10 lines

arch/arm/boot/dts/da850.dtsi line 217

Quoted 6 lines
arch/arm/boot/dts/da850.dtsi +5 -0
 		};
+		pinconf: pin-controller at 22c00c {
+			compatible = "ti,da850-pupd";
+			reg = <0x22c00c 0x8>;
+			status = "disabled";
+		};

Can you please place this below the i2c1 node. I am trying to keep the nodes sorted by unit address. I know thats broken in many places today, but lets add the new ones where they should eventually end up.

I can do this, but it seems that the predominant sorting pattern here is to keep subsystems together (e.g. all i2c are together, all uart are together, etc.)

Would a separate patch to sort everything by unit address to get this cleaned up be acceptable?

Quoted 4 lines

Thanks,
Sekhar

#12 lore raw

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

Quoted 28 lines · David Lechner
Quoted 16 lines · Sekhar Nori
Quoted 15 lines · David Lechner

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

---
 arch/arm/boot/dts/da850.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/da850.dtsi +0 -0
index 8945815..1c0224c 100644
@@ -210,6 +210,11 @@
 			};
 
Quoted 10 lines

arch/arm/boot/dts/da850.dtsi line 217

Quoted 6 lines
arch/arm/boot/dts/da850.dtsi +5 -0
 		};
+		pinconf: pin-controller at 22c00c {
+			compatible = "ti,da850-pupd";
+			reg = <0x22c00c 0x8>;
+			status = "disabled";
+		};

Can you please place this below the i2c1 node. I am trying to keep the nodes sorted by unit address. I know thats broken in many places today, but lets add the new ones where they should eventually end up.

Quoted 6 lines

I can do this, but it seems that the predominant sorting pattern here is to keep subsystems together (e.g. all i2c are together, all uart are together, etc.)

Would a separate patch to sort everything by unit address to get this cleaned up be acceptable?

No thanks. That kind of thing is the needless churn that gets us flamed.

Kevin

#13 lore raw

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

In reply to David Lechner
Quoted 28 lines · David Lechner
Quoted 16 lines · Sekhar Nori
Quoted 15 lines · David Lechner

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

---
 arch/arm/boot/dts/da850.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/da850.dtsi +0 -0
index 8945815..1c0224c 100644
@@ -210,6 +210,11 @@
             };
 
Quoted 10 lines

arch/arm/boot/dts/da850.dtsi line 217

Quoted 6 lines
arch/arm/boot/dts/da850.dtsi +5 -0
         };
+        pinconf: pin-controller at 22c00c {
+            compatible = "ti,da850-pupd";
+            reg = <0x22c00c 0x8>;
+            status = "disabled";
+        };

Can you please place this below the i2c1 node. I am trying to keep the nodes sorted by unit address. I know thats broken in many places today, but lets add the new ones where they should eventually end up.

Quoted 3 lines

I can do this, but it seems that the predominant sorting pattern here is to keep subsystems together (e.g. all i2c are together, all uart are together, etc.)

Yeah, but that quickly gives away as there are many singleton devices and everyone tries to add theirs at the end of the list resulting in merge conflicts.

Quoted 2 lines

Would a separate patch to sort everything by unit address to get this cleaned up be acceptable?

Agree with Kevin that it would be churn. If done, it should be last thing that gets done in a merge window. I would not attempt it in relatively busy merge windows like this one.

Thanks,
Sekhar

#8 lore raw

Re: [PATCH 2/3] pinctrl: New driver for TI DA8XX/OMAP-L138/AM18XX pinconf

In reply to David Lechner
Quoted 4 lines · David Lechner

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

Nice and clean driver, resend with the minor fixes pointed out by Sekhar and I'll merge it.

Yours,
Linus Walleij

maintainer Acked-by on v1 1/3
#4 lore raw

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

In reply to David Lechner
Quoted 8 lines · David Lechner

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

---
 .../devicetree/bindings/pinctrl/ti,da850-pupd.txt  | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.txt