Thread (2 messages) flat view 2 messages, 2 authors, 2013-01-02

[PATCH v2] pinctrl/nomadik: add device tree support

From: Stephen Warren <hidden>
Date: 2013-01-02 20:29:54
Also in: lkml

On 12/20/2012 01:35 AM, Linus Walleij wrote:
From: Gabriel Fernandez <redacted>

This implements pin multiplexing and pin configuration for
the Nomadik pin controller using the device tree.
quoted hunk ↗ jump to hunk
diff --git a/Documentation/devicetree/bindings/pinctrl/ste,nomadik.txt b/Documentation/devicetree/bindings/pinctrl/ste,nomadik.txt
+Required properties:
+- compatible: "stericsson,nmk_pinctrl"
- rather than _ is more typically used, but not a big deal.
+mux function to select on those pin(s)/group(s), and various pin configuration
+parameters, such as inputn output, pull up, pull down...
s/n/,/ ?
+Example board file extract:
+
+	pinctrl {
+		compatible = "stericsson,nmk_pinctrl";
+		reg = <0x80157000 0x2000>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&uart0_default_mode>;
...
+	uart at 80120000 {
+		compatible = "arm,pl011", "arm,primecell";
+		reg = <0x80120000 0x1000>;
+		interrupts = <0 11 0x4>;
+
+		pinctrl-names = "default","sleep";
+		pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
+		pinctrl-1 = <&uart0_sleep_mode>;
+	};
Both pinctrl and uart at 80120000 are going to try and claim/use the
content of &uart0_default_mode in that example, which I don't think will
work.
+
There's a blank line at the end of the file.
quoted hunk ↗ jump to hunk
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
+int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
+	unsigned reserve = 1;
...> +	ret = of_property_read_string(np, "ste,function", &function);
+	if (ret < 0)
+		reserve = 0;
It might be a little simpler to say:

reserve = 0;
...
	ret = of_property_read_string(np, "ste,function", &function);
	if (ret >= 0)
		reserve = 1;

but not a big deal I suppose.

Aside from that,
Reviewed-by: Stephen Warren <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help