pinctrl: samsung: Allow grouping multiple pinmux/pinconf nodes
authorTomasz Figa <t.figa@samsung.com>
Sat, 12 Oct 2013 08:01:39 +0000 (10:01 +0200)
committerChanho Park <chanho61.park@samsung.com>
Thu, 7 Aug 2014 06:17:45 +0000 (15:17 +0900)
commit3218a4b4a7f350bdb8e26b2da1379569fc679d78
tree179e537618f3982d40cee65a0154a86dca7b02bd
parent06d16cbb4f34ea247cabce5457ada97ea95001c9
pinctrl: samsung: Allow grouping multiple pinmux/pinconf nodes

One of remaining limitations of current pinctrl-samsung driver was
the inability to parse multiple pinmux/pinconf group nodes grouped
inside a single device tree node. It made defining groups of pins for
single purpose, but with different parameters very inconvenient.

This patch implements Tegra-like support for grouping multiple pinctrl
groups inside one device tree node, by completely changing the way
pin groups and functions are parsed from device tree. The code creating
pinctrl maps from DT nodes has been borrowed from pinctrl-tegra, while
the initial creation of groups and functions has been completely
rewritten with following assumptions:
 - each group consists of just one pin and does not depend on data
   from device tree,
 - each function is represented by a device tree child node of the
   pin controller, which in turn can contain multiple child nodes
   for pins that need to have different configuration values.

Device Tree bindings are fully backwards compatible. New functionality
can be used by defining a new pinctrl group consisting of several child
nodes, as on following example:

sd4_bus8: sd4-bus-width8 {
part-1 {
samsung,pins = "gpk0-3", "gpk0-4",
"gpk0-5", "gpk0-6";
samsung,pin-function = <3>;
samsung,pin-pud = <3>;
samsung,pin-drv = <3>;
};
part-2 {
samsung,pins = "gpk1-3", "gpk1-4",
"gpk1-5", "gpk1-6";
samsung,pin-function = <4>;
samsung,pin-pud = <4>;
samsung,pin-drv = <3>;
};
};

Tested on custom Exynos 4212-based board.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
drivers/pinctrl/pinctrl-samsung.c
drivers/pinctrl/pinctrl-samsung.h