summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2016-11-03 12:35:47 -0400
committerLinus Walleij <linus.walleij@linaro.org>2016-11-04 17:50:55 -0400
commit42124bc598f64f84b3335d5a058304207695b84f (patch)
tree0faea03d1084618e3799c5eda2b20aebdbe59f10 /Documentation
parentb83bd893f3a04d35f5bfcf399c1034660e5b2403 (diff)
pinctrl: Introduce generic #pinctrl-cells and pinctrl_parse_index_with_args
Introduce #pinctrl-cells helper binding and generic helper functions pinctrl_count_index_with_args() and pinctrl_parse_index_with_args(). Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> [Forward-declare of_phandle_args] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt44
1 files changed, 43 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
index b73c96d24f59..bf3f7b014724 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
@@ -97,6 +97,11 @@ For example:
97 }; 97 };
98 98
99== Pin controller devices == 99== Pin controller devices ==
100Required properties: See the pin controller driver specific documentation
101
102Optional properties:
103#pinctrl-cells: Number of pin control cells in addition to the index within the
104 pin controller device instance
100 105
101Pin controller devices should contain the pin configuration nodes that client 106Pin controller devices should contain the pin configuration nodes that client
102devices reference. 107devices reference.
@@ -119,7 +124,8 @@ For example:
119 124
120The contents of each of those pin configuration child nodes is defined 125The contents of each of those pin configuration child nodes is defined
121entirely by the binding for the individual pin controller device. There 126entirely by the binding for the individual pin controller device. There
122exists no common standard for this content. 127exists no common standard for this content. The pinctrl framework only
128provides generic helper bindings that the pin controller driver can use.
123 129
124The pin configuration nodes need not be direct children of the pin controller 130The pin configuration nodes need not be direct children of the pin controller
125device; they may be grandchildren, for example. Whether this is legal, and 131device; they may be grandchildren, for example. Whether this is legal, and
@@ -156,6 +162,42 @@ state_2_node_a {
156 pins = "mfio29", "mfio30"; 162 pins = "mfio29", "mfio30";
157}; 163};
158 164
165Optionally an altenative binding can be used if more suitable depending on the
166pin controller hardware. For hardaware where there is a large number of identical
167pin controller instances, naming each pin and function can easily become
168unmaintainable. This is especially the case if the same controller is used for
169different pins and functions depending on the SoC revision and packaging.
170
171For cases like this, the pin controller driver may use pinctrl-pin-array helper
172binding with a hardware based index and a number of pin configuration values:
173
174pincontroller {
175 ... /* Standard DT properties for the device itself elided */
176 #pinctrl-cells = <2>;
177
178 state_0_node_a {
179 pinctrl-pin-array = <
180 0 A_DELAY_PS(0) G_DELAY_PS(120)
181 4 A_DELAY_PS(0) G_DELAY_PS(360)
182 ...
183 >;
184 };
185 ...
186};
187
188Above #pinctrl-cells specifies the number of value cells in addition to the
189index of the registers. This is similar to the interrupts-extended binding with
190one exception. There is no need to specify the phandle for each entry as that
191is already known as the defined pins are always children of the pin controller
192node. Further having the phandle pointing to another pin controller would not
193currently work as the pinctrl framework uses named modes to group pins for each
194pin control device.
195
196The index for pinctrl-pin-array must relate to the hardware for the pinctrl
197registers, and must not be a virtual index of pin instances. The reason for
198this is to avoid mapping of the index in the dts files and the pin controller
199driver as it can change.
200
159== Generic pin configuration node content == 201== Generic pin configuration node content ==
160 202
161Many data items that are represented in a pin configuration node are common 203Many data items that are represented in a pin configuration node are common