diff options
author | Tony Lindgren <tony@atomide.com> | 2016-11-03 12:35:47 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-11-04 17:50:55 -0400 |
commit | 42124bc598f64f84b3335d5a058304207695b84f (patch) | |
tree | 0faea03d1084618e3799c5eda2b20aebdbe59f10 /Documentation | |
parent | b83bd893f3a04d35f5bfcf399c1034660e5b2403 (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.txt | 44 |
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 == |
100 | Required properties: See the pin controller driver specific documentation | ||
101 | |||
102 | Optional properties: | ||
103 | #pinctrl-cells: Number of pin control cells in addition to the index within the | ||
104 | pin controller device instance | ||
100 | 105 | ||
101 | Pin controller devices should contain the pin configuration nodes that client | 106 | Pin controller devices should contain the pin configuration nodes that client |
102 | devices reference. | 107 | devices reference. |
@@ -119,7 +124,8 @@ For example: | |||
119 | 124 | ||
120 | The contents of each of those pin configuration child nodes is defined | 125 | The contents of each of those pin configuration child nodes is defined |
121 | entirely by the binding for the individual pin controller device. There | 126 | entirely by the binding for the individual pin controller device. There |
122 | exists no common standard for this content. | 127 | exists no common standard for this content. The pinctrl framework only |
128 | provides generic helper bindings that the pin controller driver can use. | ||
123 | 129 | ||
124 | The pin configuration nodes need not be direct children of the pin controller | 130 | The pin configuration nodes need not be direct children of the pin controller |
125 | device; they may be grandchildren, for example. Whether this is legal, and | 131 | device; 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 | ||
165 | Optionally an altenative binding can be used if more suitable depending on the | ||
166 | pin controller hardware. For hardaware where there is a large number of identical | ||
167 | pin controller instances, naming each pin and function can easily become | ||
168 | unmaintainable. This is especially the case if the same controller is used for | ||
169 | different pins and functions depending on the SoC revision and packaging. | ||
170 | |||
171 | For cases like this, the pin controller driver may use pinctrl-pin-array helper | ||
172 | binding with a hardware based index and a number of pin configuration values: | ||
173 | |||
174 | pincontroller { | ||
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 | |||
188 | Above #pinctrl-cells specifies the number of value cells in addition to the | ||
189 | index of the registers. This is similar to the interrupts-extended binding with | ||
190 | one exception. There is no need to specify the phandle for each entry as that | ||
191 | is already known as the defined pins are always children of the pin controller | ||
192 | node. Further having the phandle pointing to another pin controller would not | ||
193 | currently work as the pinctrl framework uses named modes to group pins for each | ||
194 | pin control device. | ||
195 | |||
196 | The index for pinctrl-pin-array must relate to the hardware for the pinctrl | ||
197 | registers, and must not be a virtual index of pin instances. The reason for | ||
198 | this is to avoid mapping of the index in the dts files and the pin controller | ||
199 | driver as it can change. | ||
200 | |||
159 | == Generic pin configuration node content == | 201 | == Generic pin configuration node content == |
160 | 202 | ||
161 | Many data items that are represented in a pin configuration node are common | 203 | Many data items that are represented in a pin configuration node are common |