diff options
Diffstat (limited to 'Documentation')
9 files changed, 781 insertions, 23 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000000000000..9e9e9ef9f852 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt | |||
@@ -0,0 +1,461 @@ | |||
1 | Broadcom Capri Pin Controller | ||
2 | |||
3 | This is a pin controller for the Broadcom BCM281xx SoC family, which includes | ||
4 | BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. | ||
5 | |||
6 | === Pin Controller Node === | ||
7 | |||
8 | Required Properties: | ||
9 | |||
10 | - compatible: Must be "brcm,capri-pinctrl". | ||
11 | - reg: Base address of the PAD Controller register block and the size | ||
12 | of the block. | ||
13 | |||
14 | For example, the following is the bare minimum node: | ||
15 | |||
16 | pinctrl@35004800 { | ||
17 | compatible = "brcm,capri-pinctrl"; | ||
18 | reg = <0x35004800 0x430>; | ||
19 | }; | ||
20 | |||
21 | As a pin controller device, in addition to the required properties, this node | ||
22 | should also contain the pin configuration nodes that client devices reference, | ||
23 | if any. | ||
24 | |||
25 | === Pin Configuration Node === | ||
26 | |||
27 | Each pin configuration node is a sub-node of the pin controller node and is a | ||
28 | container of an arbitrary number of subnodes, called pin group nodes in this | ||
29 | document. | ||
30 | |||
31 | Please refer to the pinctrl-bindings.txt in this directory for details of the | ||
32 | common pinctrl bindings used by client devices, including the definition of a | ||
33 | "pin configuration node". | ||
34 | |||
35 | === Pin Group Node === | ||
36 | |||
37 | A pin group node specifies the desired pin mux and/or pin configuration for an | ||
38 | arbitrary number of pins. The name of the pin group node is optional and not | ||
39 | used. | ||
40 | |||
41 | A pin group node only affects the properties specified in the node, and has no | ||
42 | effect on any properties that are omitted. | ||
43 | |||
44 | The pin group node accepts a subset of the generic pin config properties. For | ||
45 | details generic pin config properties, please refer to pinctrl-bindings.txt | ||
46 | and <include/linux/pinctrl/pinconfig-generic.h>. | ||
47 | |||
48 | Each pin controlled by this pin controller belong to one of three types: | ||
49 | Standard, I2C, and HDMI. Each type accepts a different set of pin config | ||
50 | properties. A list of pins and their types is provided below. | ||
51 | |||
52 | Required Properties (applicable to all pins): | ||
53 | |||
54 | - pins: Multiple strings. Specifies the name(s) of one or more pins to | ||
55 | be configured by this node. | ||
56 | |||
57 | Optional Properties (for standard pins): | ||
58 | |||
59 | - function: String. Specifies the pin mux selection. Values | ||
60 | must be one of: "alt1", "alt2", "alt3", "alt4" | ||
61 | - input-schmitt-enable: No arguments. Enable schmitt-trigger mode. | ||
62 | - input-schmitt-disable: No arguments. Disable schmitt-trigger mode. | ||
63 | - bias-pull-up: No arguments. Pull up on pin. | ||
64 | - bias-pull-down: No arguments. Pull down on pin. | ||
65 | - bias-disable: No arguments. Disable pin bias. | ||
66 | - slew-rate: Integer. Meaning depends on configured pin mux: | ||
67 | *_SCL or *_SDA: | ||
68 | 0: Standard(100kbps)& Fast(400kbps) mode | ||
69 | 1: Highspeed (3.4Mbps) mode | ||
70 | IC_DM or IC_DP: | ||
71 | 0: normal slew rate | ||
72 | 1: fast slew rate | ||
73 | Otherwise: | ||
74 | 0: fast slew rate | ||
75 | 1: normal slew rate | ||
76 | - input-enable: No arguements. Enable input (does not affect | ||
77 | output.) | ||
78 | - input-disable: No arguements. Disable input (does not affect | ||
79 | output.) | ||
80 | - drive-strength: Integer. Drive strength in mA. Valid values are | ||
81 | 2, 4, 6, 8, 10, 12, 14, 16 mA. | ||
82 | |||
83 | Optional Properties (for I2C pins): | ||
84 | |||
85 | - function: String. Specifies the pin mux selection. Values | ||
86 | must be one of: "alt1", "alt2", "alt3", "alt4" | ||
87 | - bias-pull-up: Integer. Pull up strength in Ohm. There are 3 | ||
88 | pull-up resisitors (1.2k, 1.8k, 2.7k) available | ||
89 | in parallel for I2C pins, so the valid values | ||
90 | are: 568, 720, 831, 1080, 1200, 1800, 2700 Ohm. | ||
91 | - bias-disable: No arguments. Disable pin bias. | ||
92 | - slew-rate: Integer. Meaning depends on configured pin mux: | ||
93 | *_SCL or *_SDA: | ||
94 | 0: Standard(100kbps)& Fast(400kbps) mode | ||
95 | 1: Highspeed (3.4Mbps) mode | ||
96 | IC_DM or IC_DP: | ||
97 | 0: normal slew rate | ||
98 | 1: fast slew rate | ||
99 | Otherwise: | ||
100 | 0: fast slew rate | ||
101 | 1: normal slew rate | ||
102 | - input-enable: No arguements. Enable input (does not affect | ||
103 | output.) | ||
104 | - input-disable: No arguements. Disable input (does not affect | ||
105 | output.) | ||
106 | |||
107 | Optional Properties (for HDMI pins): | ||
108 | |||
109 | - function: String. Specifies the pin mux selection. Values | ||
110 | must be one of: "alt1", "alt2", "alt3", "alt4" | ||
111 | - slew-rate: Integer. Controls slew rate. | ||
112 | 0: Standard(100kbps)& Fast(400kbps) mode | ||
113 | 1: Highspeed (3.4Mbps) mode | ||
114 | - input-enable: No arguements. Enable input (does not affect | ||
115 | output.) | ||
116 | - input-disable: No arguements. Disable input (does not affect | ||
117 | output.) | ||
118 | |||
119 | Example: | ||
120 | // pin controller node | ||
121 | pinctrl@35004800 { | ||
122 | compatible = "brcm,capri-pinctrl"; | ||
123 | reg = <0x35004800 0x430>; | ||
124 | |||
125 | // pin configuration node | ||
126 | dev_a_default: dev_a_active { | ||
127 | //group node defining 1 standard pin | ||
128 | grp_1 { | ||
129 | pins = "std_pin1"; | ||
130 | function = "alt1"; | ||
131 | input-schmitt-enable; | ||
132 | bias-disable; | ||
133 | slew-rate = <1>; | ||
134 | drive-strength = <4>; | ||
135 | }; | ||
136 | |||
137 | // group node defining 2 I2C pins | ||
138 | grp_2 { | ||
139 | pins = "i2c_pin1", "i2c_pin2"; | ||
140 | function = "alt2"; | ||
141 | bias-pull-up = <720>; | ||
142 | input-enable; | ||
143 | }; | ||
144 | |||
145 | // group node defining 2 HDMI pins | ||
146 | grp_3 { | ||
147 | pins = "hdmi_pin1", "hdmi_pin2"; | ||
148 | function = "alt3"; | ||
149 | slew-rate = <1>; | ||
150 | }; | ||
151 | |||
152 | // other pin group nodes | ||
153 | ... | ||
154 | }; | ||
155 | |||
156 | // other pin configuration nodes | ||
157 | ... | ||
158 | }; | ||
159 | |||
160 | In the example above, "dev_a_active" is a pin configuration node with a number | ||
161 | of sub-nodes. In the pin group node "grp_1", one pin, "std_pin1", is defined in | ||
162 | the "pins" property. Thus, the remaining properties in the "grp_1" node applies | ||
163 | only to this pin, including the following settings: | ||
164 | - setting pinmux to "alt1" | ||
165 | - enabling schmitt-trigger (hystersis) mode | ||
166 | - disabling pin bias | ||
167 | - setting the slew-rate to 1 | ||
168 | - setting the drive strength to 4 mA | ||
169 | Note that neither "input-enable" nor "input-disable" was specified - the pinctrl | ||
170 | subsystem will therefore leave this property unchanged from whatever state it | ||
171 | was in before applying these changes. | ||
172 | |||
173 | The "pins" property in the pin group node "grp_2" specifies two pins - | ||
174 | "i2c_pin1" and "i2c_pin2"; the remaining properties in this pin group node, | ||
175 | therefore, applies to both of these pins. The properties include: | ||
176 | - setting pinmux to "alt2" | ||
177 | - setting pull-up resistance to 720 Ohm (ie. enabling 1.2k and 1.8k resistors | ||
178 | in parallel) | ||
179 | - enabling both pins' input | ||
180 | "slew-rate" is not specified in this pin group node, so the slew-rate for these | ||
181 | pins are left as-is. | ||
182 | |||
183 | Finally, "grp_3" defines two HDMI pins. The following properties are applied to | ||
184 | both pins: | ||
185 | - setting pinmux to "alt3" | ||
186 | - setting slew-rate to 1; for HDMI pins, this corresponds to the 3.4 Mbps | ||
187 | Highspeed mode | ||
188 | The input is neither enabled or disabled, and is left untouched. | ||
189 | |||
190 | === Pin Names and Type === | ||
191 | |||
192 | The following are valid pin names and their pin types: | ||
193 | |||
194 | "adcsync", Standard | ||
195 | "bat_rm", Standard | ||
196 | "bsc1_scl", I2C | ||
197 | "bsc1_sda", I2C | ||
198 | "bsc2_scl", I2C | ||
199 | "bsc2_sda", I2C | ||
200 | "classgpwr", Standard | ||
201 | "clk_cx8", Standard | ||
202 | "clkout_0", Standard | ||
203 | "clkout_1", Standard | ||
204 | "clkout_2", Standard | ||
205 | "clkout_3", Standard | ||
206 | "clkreq_in_0", Standard | ||
207 | "clkreq_in_1", Standard | ||
208 | "cws_sys_req1", Standard | ||
209 | "cws_sys_req2", Standard | ||
210 | "cws_sys_req3", Standard | ||
211 | "digmic1_clk", Standard | ||
212 | "digmic1_dq", Standard | ||
213 | "digmic2_clk", Standard | ||
214 | "digmic2_dq", Standard | ||
215 | "gpen13", Standard | ||
216 | "gpen14", Standard | ||
217 | "gpen15", Standard | ||
218 | "gpio00", Standard | ||
219 | "gpio01", Standard | ||
220 | "gpio02", Standard | ||
221 | "gpio03", Standard | ||
222 | "gpio04", Standard | ||
223 | "gpio05", Standard | ||
224 | "gpio06", Standard | ||
225 | "gpio07", Standard | ||
226 | "gpio08", Standard | ||
227 | "gpio09", Standard | ||
228 | "gpio10", Standard | ||
229 | "gpio11", Standard | ||
230 | "gpio12", Standard | ||
231 | "gpio13", Standard | ||
232 | "gpio14", Standard | ||
233 | "gps_pablank", Standard | ||
234 | "gps_tmark", Standard | ||
235 | "hdmi_scl", HDMI | ||
236 | "hdmi_sda", HDMI | ||
237 | "ic_dm", Standard | ||
238 | "ic_dp", Standard | ||
239 | "kp_col_ip_0", Standard | ||
240 | "kp_col_ip_1", Standard | ||
241 | "kp_col_ip_2", Standard | ||
242 | "kp_col_ip_3", Standard | ||
243 | "kp_row_op_0", Standard | ||
244 | "kp_row_op_1", Standard | ||
245 | "kp_row_op_2", Standard | ||
246 | "kp_row_op_3", Standard | ||
247 | "lcd_b_0", Standard | ||
248 | "lcd_b_1", Standard | ||
249 | "lcd_b_2", Standard | ||
250 | "lcd_b_3", Standard | ||
251 | "lcd_b_4", Standard | ||
252 | "lcd_b_5", Standard | ||
253 | "lcd_b_6", Standard | ||
254 | "lcd_b_7", Standard | ||
255 | "lcd_g_0", Standard | ||
256 | "lcd_g_1", Standard | ||
257 | "lcd_g_2", Standard | ||
258 | "lcd_g_3", Standard | ||
259 | "lcd_g_4", Standard | ||
260 | "lcd_g_5", Standard | ||
261 | "lcd_g_6", Standard | ||
262 | "lcd_g_7", Standard | ||
263 | "lcd_hsync", Standard | ||
264 | "lcd_oe", Standard | ||
265 | "lcd_pclk", Standard | ||
266 | "lcd_r_0", Standard | ||
267 | "lcd_r_1", Standard | ||
268 | "lcd_r_2", Standard | ||
269 | "lcd_r_3", Standard | ||
270 | "lcd_r_4", Standard | ||
271 | "lcd_r_5", Standard | ||
272 | "lcd_r_6", Standard | ||
273 | "lcd_r_7", Standard | ||
274 | "lcd_vsync", Standard | ||
275 | "mdmgpio0", Standard | ||
276 | "mdmgpio1", Standard | ||
277 | "mdmgpio2", Standard | ||
278 | "mdmgpio3", Standard | ||
279 | "mdmgpio4", Standard | ||
280 | "mdmgpio5", Standard | ||
281 | "mdmgpio6", Standard | ||
282 | "mdmgpio7", Standard | ||
283 | "mdmgpio8", Standard | ||
284 | "mphi_data_0", Standard | ||
285 | "mphi_data_1", Standard | ||
286 | "mphi_data_2", Standard | ||
287 | "mphi_data_3", Standard | ||
288 | "mphi_data_4", Standard | ||
289 | "mphi_data_5", Standard | ||
290 | "mphi_data_6", Standard | ||
291 | "mphi_data_7", Standard | ||
292 | "mphi_data_8", Standard | ||
293 | "mphi_data_9", Standard | ||
294 | "mphi_data_10", Standard | ||
295 | "mphi_data_11", Standard | ||
296 | "mphi_data_12", Standard | ||
297 | "mphi_data_13", Standard | ||
298 | "mphi_data_14", Standard | ||
299 | "mphi_data_15", Standard | ||
300 | "mphi_ha0", Standard | ||
301 | "mphi_hat0", Standard | ||
302 | "mphi_hat1", Standard | ||
303 | "mphi_hce0_n", Standard | ||
304 | "mphi_hce1_n", Standard | ||
305 | "mphi_hrd_n", Standard | ||
306 | "mphi_hwr_n", Standard | ||
307 | "mphi_run0", Standard | ||
308 | "mphi_run1", Standard | ||
309 | "mtx_scan_clk", Standard | ||
310 | "mtx_scan_data", Standard | ||
311 | "nand_ad_0", Standard | ||
312 | "nand_ad_1", Standard | ||
313 | "nand_ad_2", Standard | ||
314 | "nand_ad_3", Standard | ||
315 | "nand_ad_4", Standard | ||
316 | "nand_ad_5", Standard | ||
317 | "nand_ad_6", Standard | ||
318 | "nand_ad_7", Standard | ||
319 | "nand_ale", Standard | ||
320 | "nand_cen_0", Standard | ||
321 | "nand_cen_1", Standard | ||
322 | "nand_cle", Standard | ||
323 | "nand_oen", Standard | ||
324 | "nand_rdy_0", Standard | ||
325 | "nand_rdy_1", Standard | ||
326 | "nand_wen", Standard | ||
327 | "nand_wp", Standard | ||
328 | "pc1", Standard | ||
329 | "pc2", Standard | ||
330 | "pmu_int", Standard | ||
331 | "pmu_scl", I2C | ||
332 | "pmu_sda", I2C | ||
333 | "rfst2g_mtsloten3g", Standard | ||
334 | "rgmii_0_rx_ctl", Standard | ||
335 | "rgmii_0_rxc", Standard | ||
336 | "rgmii_0_rxd_0", Standard | ||
337 | "rgmii_0_rxd_1", Standard | ||
338 | "rgmii_0_rxd_2", Standard | ||
339 | "rgmii_0_rxd_3", Standard | ||
340 | "rgmii_0_tx_ctl", Standard | ||
341 | "rgmii_0_txc", Standard | ||
342 | "rgmii_0_txd_0", Standard | ||
343 | "rgmii_0_txd_1", Standard | ||
344 | "rgmii_0_txd_2", Standard | ||
345 | "rgmii_0_txd_3", Standard | ||
346 | "rgmii_1_rx_ctl", Standard | ||
347 | "rgmii_1_rxc", Standard | ||
348 | "rgmii_1_rxd_0", Standard | ||
349 | "rgmii_1_rxd_1", Standard | ||
350 | "rgmii_1_rxd_2", Standard | ||
351 | "rgmii_1_rxd_3", Standard | ||
352 | "rgmii_1_tx_ctl", Standard | ||
353 | "rgmii_1_txc", Standard | ||
354 | "rgmii_1_txd_0", Standard | ||
355 | "rgmii_1_txd_1", Standard | ||
356 | "rgmii_1_txd_2", Standard | ||
357 | "rgmii_1_txd_3", Standard | ||
358 | "rgmii_gpio_0", Standard | ||
359 | "rgmii_gpio_1", Standard | ||
360 | "rgmii_gpio_2", Standard | ||
361 | "rgmii_gpio_3", Standard | ||
362 | "rtxdata2g_txdata3g1", Standard | ||
363 | "rtxen2g_txdata3g2", Standard | ||
364 | "rxdata3g0", Standard | ||
365 | "rxdata3g1", Standard | ||
366 | "rxdata3g2", Standard | ||
367 | "sdio1_clk", Standard | ||
368 | "sdio1_cmd", Standard | ||
369 | "sdio1_data_0", Standard | ||
370 | "sdio1_data_1", Standard | ||
371 | "sdio1_data_2", Standard | ||
372 | "sdio1_data_3", Standard | ||
373 | "sdio4_clk", Standard | ||
374 | "sdio4_cmd", Standard | ||
375 | "sdio4_data_0", Standard | ||
376 | "sdio4_data_1", Standard | ||
377 | "sdio4_data_2", Standard | ||
378 | "sdio4_data_3", Standard | ||
379 | "sim_clk", Standard | ||
380 | "sim_data", Standard | ||
381 | "sim_det", Standard | ||
382 | "sim_resetn", Standard | ||
383 | "sim2_clk", Standard | ||
384 | "sim2_data", Standard | ||
385 | "sim2_det", Standard | ||
386 | "sim2_resetn", Standard | ||
387 | "sri_c", Standard | ||
388 | "sri_d", Standard | ||
389 | "sri_e", Standard | ||
390 | "ssp_extclk", Standard | ||
391 | "ssp0_clk", Standard | ||
392 | "ssp0_fs", Standard | ||
393 | "ssp0_rxd", Standard | ||
394 | "ssp0_txd", Standard | ||
395 | "ssp2_clk", Standard | ||
396 | "ssp2_fs_0", Standard | ||
397 | "ssp2_fs_1", Standard | ||
398 | "ssp2_fs_2", Standard | ||
399 | "ssp2_fs_3", Standard | ||
400 | "ssp2_rxd_0", Standard | ||
401 | "ssp2_rxd_1", Standard | ||
402 | "ssp2_txd_0", Standard | ||
403 | "ssp2_txd_1", Standard | ||
404 | "ssp3_clk", Standard | ||
405 | "ssp3_fs", Standard | ||
406 | "ssp3_rxd", Standard | ||
407 | "ssp3_txd", Standard | ||
408 | "ssp4_clk", Standard | ||
409 | "ssp4_fs", Standard | ||
410 | "ssp4_rxd", Standard | ||
411 | "ssp4_txd", Standard | ||
412 | "ssp5_clk", Standard | ||
413 | "ssp5_fs", Standard | ||
414 | "ssp5_rxd", Standard | ||
415 | "ssp5_txd", Standard | ||
416 | "ssp6_clk", Standard | ||
417 | "ssp6_fs", Standard | ||
418 | "ssp6_rxd", Standard | ||
419 | "ssp6_txd", Standard | ||
420 | "stat_1", Standard | ||
421 | "stat_2", Standard | ||
422 | "sysclken", Standard | ||
423 | "traceclk", Standard | ||
424 | "tracedt00", Standard | ||
425 | "tracedt01", Standard | ||
426 | "tracedt02", Standard | ||
427 | "tracedt03", Standard | ||
428 | "tracedt04", Standard | ||
429 | "tracedt05", Standard | ||
430 | "tracedt06", Standard | ||
431 | "tracedt07", Standard | ||
432 | "tracedt08", Standard | ||
433 | "tracedt09", Standard | ||
434 | "tracedt10", Standard | ||
435 | "tracedt11", Standard | ||
436 | "tracedt12", Standard | ||
437 | "tracedt13", Standard | ||
438 | "tracedt14", Standard | ||
439 | "tracedt15", Standard | ||
440 | "txdata3g0", Standard | ||
441 | "txpwrind", Standard | ||
442 | "uartb1_ucts", Standard | ||
443 | "uartb1_urts", Standard | ||
444 | "uartb1_urxd", Standard | ||
445 | "uartb1_utxd", Standard | ||
446 | "uartb2_urxd", Standard | ||
447 | "uartb2_utxd", Standard | ||
448 | "uartb3_ucts", Standard | ||
449 | "uartb3_urts", Standard | ||
450 | "uartb3_urxd", Standard | ||
451 | "uartb3_utxd", Standard | ||
452 | "uartb4_ucts", Standard | ||
453 | "uartb4_urts", Standard | ||
454 | "uartb4_urxd", Standard | ||
455 | "uartb4_utxd", Standard | ||
456 | "vc_cam1_scl", I2C | ||
457 | "vc_cam1_sda", I2C | ||
458 | "vc_cam2_scl", I2C | ||
459 | "vc_cam2_sda", I2C | ||
460 | "vc_cam3_scl", I2C | ||
461 | "vc_cam3_sda", I2C | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt new file mode 100644 index 000000000000..fd653bde18d5 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | * Freescale IMX25 IOMUX Controller | ||
2 | |||
3 | Please refer to fsl,imx-pinctrl.txt in this directory for common binding part | ||
4 | and usage. | ||
5 | |||
6 | CONFIG bits definition: | ||
7 | PAD_CTL_HYS (1 << 8) | ||
8 | PAD_CTL_PKE (1 << 7) | ||
9 | PAD_CTL_PUE (1 << 6) | ||
10 | PAD_CTL_PUS_100K_DOWN (0 << 4) | ||
11 | PAD_CTL_PUS_47K_UP (1 << 4) | ||
12 | PAD_CTL_PUS_100K_UP (2 << 4) | ||
13 | PAD_CTL_PUS_22K_UP (3 << 4) | ||
14 | PAD_CTL_ODE_CMOS (0 << 3) | ||
15 | PAD_CTL_ODE_OPENDRAIN (1 << 3) | ||
16 | PAD_CTL_DSE_NOMINAL (0 << 1) | ||
17 | PAD_CTL_DSE_HIGH (1 << 1) | ||
18 | PAD_CTL_DSE_MAX (2 << 1) | ||
19 | PAD_CTL_SRE_FAST (1 << 0) | ||
20 | PAD_CTL_SRE_SLOW (0 << 0) | ||
21 | |||
22 | Refer to imx25-pinfunc.h in device tree source folder for all available | ||
23 | imx25 PIN_FUNC_ID. | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt index 353eca0efbf8..d1706ea82572 100644 --- a/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt | |||
@@ -52,12 +52,25 @@ Required properties for pin configuration node: | |||
52 | CONFIG can be 0 or 1, meaning Pullup disable/enable. | 52 | CONFIG can be 0 or 1, meaning Pullup disable/enable. |
53 | 53 | ||
54 | 54 | ||
55 | The iomux controller has gpio child nodes which are embedded in the iomux | ||
56 | control registers. They have to be defined as child nodes of the iomux device | ||
57 | node. If gpio subnodes are defined "#address-cells", "#size-cells" and "ranges" | ||
58 | properties for the iomux device node are required. | ||
55 | 59 | ||
56 | Example: | 60 | Example: |
57 | 61 | ||
58 | iomuxc: iomuxc@10015000 { | 62 | iomuxc: iomuxc@10015000 { |
59 | compatible = "fsl,imx27-iomuxc"; | 63 | compatible = "fsl,imx27-iomuxc"; |
60 | reg = <0x10015000 0x600>; | 64 | reg = <0x10015000 0x600>; |
65 | #address-cells = <1>; | ||
66 | #size-cells = <1>; | ||
67 | ranges; | ||
68 | |||
69 | gpio1: gpio@10015000 { | ||
70 | ... | ||
71 | }; | ||
72 | |||
73 | ... | ||
61 | 74 | ||
62 | uart { | 75 | uart { |
63 | pinctrl_uart1: uart-1 { | 76 | pinctrl_uart1: uart-1 { |
@@ -83,6 +96,15 @@ The above example using macros: | |||
83 | iomuxc: iomuxc@10015000 { | 96 | iomuxc: iomuxc@10015000 { |
84 | compatible = "fsl,imx27-iomuxc"; | 97 | compatible = "fsl,imx27-iomuxc"; |
85 | reg = <0x10015000 0x600>; | 98 | reg = <0x10015000 0x600>; |
99 | #address-cells = <1>; | ||
100 | #size-cells = <1>; | ||
101 | ranges; | ||
102 | |||
103 | gpio1: gpio@10015000 { | ||
104 | ... | ||
105 | }; | ||
106 | |||
107 | ... | ||
86 | 108 | ||
87 | uart { | 109 | uart { |
88 | pinctrl_uart1: uart-1 { | 110 | pinctrl_uart1: uart-1 { |
diff --git a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt new file mode 100644 index 000000000000..6464bf769460 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt | |||
@@ -0,0 +1,144 @@ | |||
1 | NVIDIA Tegra124 pinmux controller | ||
2 | |||
3 | The Tegra124 pinctrl binding is very similar to the Tegra20 and Tegra30 | ||
4 | pinctrl binding, as described in nvidia,tegra20-pinmux.txt and | ||
5 | nvidia,tegra30-pinmux.txt. In fact, this document assumes that binding as | ||
6 | a baseline, and only documents the differences between the two bindings. | ||
7 | |||
8 | Required properties: | ||
9 | - compatible: "nvidia,tegra124-pinmux" | ||
10 | - reg: Should contain a list of base address and size pairs for: | ||
11 | -- first entry - the drive strength and pad control registers. | ||
12 | -- second entry - the pinmux registers | ||
13 | |||
14 | Tegra124 adds the following optional properties for pin configuration subnodes. | ||
15 | The macros for options are defined in the | ||
16 | include/dt-binding/pinctrl/pinctrl-tegra.h. | ||
17 | - nvidia,enable-input: Integer. Enable the pin's input path. | ||
18 | enable :TEGRA_PIN_ENABLE0 and | ||
19 | disable or output only: TEGRA_PIN_DISABLE. | ||
20 | - nvidia,open-drain: Integer. | ||
21 | enable: TEGRA_PIN_ENABLE. | ||
22 | disable: TEGRA_PIN_DISABLE. | ||
23 | - nvidia,lock: Integer. Lock the pin configuration against further changes | ||
24 | until reset. | ||
25 | enable: TEGRA_PIN_ENABLE. | ||
26 | disable: TEGRA_PIN_DISABLE. | ||
27 | - nvidia,io-reset: Integer. Reset the IO path. | ||
28 | enable: TEGRA_PIN_ENABLE. | ||
29 | disable: TEGRA_PIN_DISABLE. | ||
30 | - nvidia,rcv-sel: Integer. Select VIL/VIH receivers. | ||
31 | normal: TEGRA_PIN_DISABLE | ||
32 | high: TEGRA_PIN_ENABLE | ||
33 | |||
34 | Please refer the Tegra TRM for complete details regarding which groups | ||
35 | support which functionality. | ||
36 | |||
37 | Valid values for pin and group names are: | ||
38 | |||
39 | per-pin mux groups: | ||
40 | |||
41 | These all support nvidia,function, nvidia,tristate, nvidia,pull, | ||
42 | nvidia,enable-input. Some support nvidia,lock nvidia,open-drain, | ||
43 | nvidia,io-reset and nvidia,rcv-sel. | ||
44 | |||
45 | ulpi_data0_po1, ulpi_data1_po2, ulpi_data2_po3, ulpi_data3_po4, | ||
46 | ulpi_data4_po5, ulpi_data5_po6, ulpi_data6_po7, ulpi_data7_po0, | ||
47 | ulpi_clk_py0, ulpi_dir_py1, ulpi_nxt_py2, ulpi_stp_py3, dap3_fs_pp0, | ||
48 | dap3_din_pp1, dap3_dout_pp2, dap3_sclk_pp3, pv0, pv1, sdmmc1_clk_pz0, | ||
49 | sdmmc1_cmd_pz1, sdmmc1_dat3_py4, sdmmc1_dat2_py5, sdmmc1_dat1_py6, | ||
50 | sdmmc1_dat0_py7, clk2_out_pw5, clk2_req_pcc5, hdmi_int_pn7, ddc_scl_pv4, | ||
51 | ddc_sda_pv5, uart2_rxd_pc3, uart2_txd_pc2, uart2_rts_n_pj6, | ||
52 | uart2_cts_n_pj5, uart3_txd_pw6, uart3_rxd_pw7, uart3_cts_n_pa1, | ||
53 | uart3_rts_n_pc0, pu0, pu1, pu2, pu3, pu4, pu5, pu6, gen1_i2c_scl_pc4, | ||
54 | gen1_i2c_sda_pc5, dap4_fs_pp4, dap4_din_pp5, dap4_dout_pp6, | ||
55 | dap4_sclk_pp7, clk3_out_pee0, clk3_req_pee1, pc7, pi5, pi7, pk0, pk1, | ||
56 | pj0, pj2, pk3, pk4, pk2, pi3, pi6, pg0, pg1, pg2, pg3, pg4, pg5, pg6, | ||
57 | pg7, ph0, ph1, ph2, ph3, ph4, ph5, ph6, ph7, pj7, pb0, pb1, pk7, pi0, | ||
58 | pi1, pi2, pi4, gen2_i2c_scl_pt5, gen2_i2c_sda_pt6, sdmmc4_clk_pcc4, | ||
59 | sdmmc4_cmd_pt7, sdmmc4_dat0_paa0, sdmmc4_dat1_paa1, sdmmc4_dat2_paa2, | ||
60 | sdmmc4_dat3_paa3, sdmmc4_dat4_paa4, sdmmc4_dat5_paa5, sdmmc4_dat6_paa6, | ||
61 | sdmmc4_dat7_paa7, cam_mclk_pcc0, pcc1, pbb0, cam_i2c_scl_pbb1, | ||
62 | cam_i2c_sda_pbb2, pbb3, pbb4, pbb5, pbb6, pbb7, pcc2, jtag_rtck, | ||
63 | pwr_i2c_scl_pz6, pwr_i2c_sda_pz7, kb_row0_pr0, kb_row1_pr1, kb_row2_pr2, | ||
64 | kb_row3_pr3, kb_row4_pr4, kb_row5_pr5, kb_row6_pr6, kb_row7_pr7, | ||
65 | kb_row8_ps0, kb_row9_ps1, kb_row10_ps2, kb_row11_ps3, kb_row12_ps4, | ||
66 | kb_row13_ps5, kb_row14_ps6, kb_row15_ps7, kb_col0_pq0, kb_col1_pq1, | ||
67 | kb_col2_pq2, kb_col3_pq3, kb_col4_pq4, kb_col5_pq5, kb_col6_pq6, | ||
68 | kb_col7_pq7, clk_32k_out_pa0, core_pwr_req, cpu_pwr_req, pwr_int_n, | ||
69 | clk_32k_in, owr, dap1_fs_pn0, dap1_din_pn1, dap1_dout_pn2, | ||
70 | dap1_sclk_pn3, dap_mclk1_req_pee2, dap_mclk1_pw4, spdif_in_pk6, | ||
71 | spdif_out_pk5, dap2_fs_pa2, dap2_din_pa4, dap2_dout_pa5, dap2_sclk_pa3, | ||
72 | dvfs_pwm_px0, gpio_x1_aud_px1, gpio_x3_aud_px3, dvfs_clk_px2, | ||
73 | gpio_x4_aud_px4, gpio_x5_aud_px5, gpio_x6_aud_px6, gpio_x7_aud_px7, | ||
74 | sdmmc3_clk_pa6, sdmmc3_cmd_pa7, sdmmc3_dat0_pb7, sdmmc3_dat1_pb6, | ||
75 | sdmmc3_dat2_pb5, sdmmc3_dat3_pb4, pex_l0_rst_n_pdd1, | ||
76 | pex_l0_clkreq_n_pdd2, pex_wake_n_pdd3, pex_l1_rst_n_pdd5, | ||
77 | pex_l1_clkreq_n_pdd6, hdmi_cec_pee3, sdmmc1_wp_n_pv3, | ||
78 | sdmmc3_cd_n_pv2, gpio_w2_aud_pw2, gpio_w3_aud_pw3, usb_vbus_en0_pn4, | ||
79 | usb_vbus_en1_pn5, sdmmc3_clk_lb_out_pee4, sdmmc3_clk_lb_in_pee5, | ||
80 | gmi_clk_lb, reset_out_n, kb_row16_pt0, kb_row17_pt1, usb_vbus_en2_pff1, | ||
81 | pff2, dp_hpd_pff0, | ||
82 | |||
83 | drive groups: | ||
84 | |||
85 | These all support nvidia,pull-down-strength, nvidia,pull-up-strength, | ||
86 | nvidia,slew-rate-rising, nvidia,slew-rate-falling. Most but not all | ||
87 | support nvidia,high-speed-mode, nvidia,schmitt, nvidia,low-power-mode | ||
88 | and nvidia,drive-type. | ||
89 | |||
90 | ao1, ao2, at1, at2, at3, at4, at5, cdev1, cdev2, dap1, dap2, dap3, dap4, | ||
91 | dbg, sdio3, spi, uaa, uab, uart2, uart3, sdio1, ddc, gma, gme, gmf, gmg, | ||
92 | gmh, owr, uda, gpv, dev3, cec, usb_vbus_en, ao3, ao0, hv0, sdio4, ao4. | ||
93 | |||
94 | Valid values for nvidia,functions are: | ||
95 | |||
96 | blink, cec, cldvfs, clk12, cpu, dap, dap1, dap2, dev3, displaya, | ||
97 | displaya_alt, displayb, dtv, extperiph1, extperiph2, extperiph3, | ||
98 | gmi, gmi_alt, hda, hsi, i2c1, i2c2, i2c3, i2c4, i2cpwr, i2s0, | ||
99 | i2s1, i2s2, i2s3, i2s4, irda, kbc, owr, pmi, pwm0, pwm1, pwm2, pwm3, | ||
100 | pwron, reset_out_n, rsvd1, rsvd2, rsvd3, rsvd4, sdmmc1, sdmmc2, sdmmc3, | ||
101 | sdmmc4, soc, spdif, spi1, spi2, spi3, spi4, spi5, spi6, trace, uarta, | ||
102 | uartb, uartc, uartd, ulpi, usb, vgp1, vgp2, vgp3, vgp4, vgp5, vgp6, | ||
103 | vi, vi_alt1, vi_alt3, vimclk2, vimclk2_alt, sata, ccla, pe0, pe, pe1, | ||
104 | dp, rtck, sys, clk tmds. | ||
105 | |||
106 | Example: | ||
107 | |||
108 | pinmux: pinmux { | ||
109 | compatible = "nvidia,tegra124-pinmux"; | ||
110 | reg = <0x70000868 0x164 /* Pad control registers */ | ||
111 | 0x70003000 0x434>; /* PinMux registers */ | ||
112 | }; | ||
113 | |||
114 | Example pinmux entries: | ||
115 | |||
116 | pinctrl { | ||
117 | sdmmc4_default: pinmux { | ||
118 | sdmmc4_clk_pcc4 { | ||
119 | nvidia,pins = "sdmmc4_clk_pcc4", | ||
120 | nvidia,function = "sdmmc4"; | ||
121 | nvidia,pull = <TEGRA_PIN_PULL_NONE>; | ||
122 | nvidia,tristate = <TEGRA_PIN_DISABLE>; | ||
123 | }; | ||
124 | |||
125 | sdmmc4_dat0_paa0 { | ||
126 | nvidia,pins = "sdmmc4_dat0_paa0", | ||
127 | "sdmmc4_dat1_paa1", | ||
128 | "sdmmc4_dat2_paa2", | ||
129 | "sdmmc4_dat3_paa3", | ||
130 | "sdmmc4_dat4_paa4", | ||
131 | "sdmmc4_dat5_paa5", | ||
132 | "sdmmc4_dat6_paa6", | ||
133 | "sdmmc4_dat7_paa7"; | ||
134 | nvidia,function = "sdmmc4"; | ||
135 | nvidia,pull = <TEGRA_PIN_PULL_UP>; | ||
136 | nvidia,tristate = <TEGRA_PIN_DISABLE>; | ||
137 | }; | ||
138 | }; | ||
139 | }; | ||
140 | |||
141 | sdhci@78000400 { | ||
142 | pinctrl-names = "default"; | ||
143 | pinctrl-0 = <&sdmmc4_default>; | ||
144 | }; | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index 1958ca9f9e5c..4414163e76d2 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt | |||
@@ -151,6 +151,8 @@ drive-push-pull - drive actively high and low | |||
151 | drive-open-drain - drive with open drain | 151 | drive-open-drain - drive with open drain |
152 | drive-open-source - drive with open source | 152 | drive-open-source - drive with open source |
153 | drive-strength - sink or source at most X mA | 153 | drive-strength - sink or source at most X mA |
154 | input-enable - enable input on pin (no effect on output) | ||
155 | input-disable - disable input on pin (no effect on output) | ||
154 | input-schmitt-enable - enable schmitt-trigger mode | 156 | input-schmitt-enable - enable schmitt-trigger mode |
155 | input-schmitt-disable - disable schmitt-trigger mode | 157 | input-schmitt-disable - disable schmitt-trigger mode |
156 | input-debounce - debounce mode with debound time X | 158 | input-debounce - debounce mode with debound time X |
@@ -158,6 +160,7 @@ low-power-enable - enable low power mode | |||
158 | low-power-disable - disable low power mode | 160 | low-power-disable - disable low power mode |
159 | output-low - set the pin to output mode with low level | 161 | output-low - set the pin to output mode with low level |
160 | output-high - set the pin to output mode with high level | 162 | output-high - set the pin to output mode with high level |
163 | slew-rate - set the slew rate | ||
161 | 164 | ||
162 | Some of the generic properties take arguments. For those that do, the | 165 | Some of the generic properties take arguments. For those that do, the |
163 | arguments are described below. | 166 | arguments are described below. |
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt index 7069a0b84e3a..bc0dfdfdb148 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt | |||
@@ -98,7 +98,7 @@ below for more information. | |||
98 | In case when one register changes more than one pin's mux the | 98 | In case when one register changes more than one pin's mux the |
99 | pinctrl-single,bits need to be used which takes three parameters: | 99 | pinctrl-single,bits need to be used which takes three parameters: |
100 | 100 | ||
101 | pinctrl-single,bits = <0xdc 0x18, 0xff>; | 101 | pinctrl-single,bits = <0xdc 0x18 0xff>; |
102 | 102 | ||
103 | Where 0xdc is the offset from the pinctrl register base address for the | 103 | Where 0xdc is the offset from the pinctrl register base address for the |
104 | device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to | 104 | device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to |
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt new file mode 100644 index 000000000000..4c352be5dd61 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt | |||
@@ -0,0 +1,92 @@ | |||
1 | Qualcomm MSM8974 TLMM block | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "qcom,msm8x74-pinctrl" | ||
5 | - reg: Should be the base address and length of the TLMM block. | ||
6 | - interrupts: Should be the parent IRQ of the TLMM block. | ||
7 | - interrupt-controller: Marks the device node as an interrupt controller. | ||
8 | - #interrupt-cells: Should be two. | ||
9 | - gpio-controller: Marks the device node as a GPIO controller. | ||
10 | - #gpio-cells : Should be two. | ||
11 | The first cell is the gpio pin number and the | ||
12 | second cell is used for optional parameters. | ||
13 | |||
14 | Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for | ||
15 | a general description of GPIO and interrupt bindings. | ||
16 | |||
17 | Please refer to pinctrl-bindings.txt in this directory for details of the | ||
18 | common pinctrl bindings used by client devices, including the meaning of the | ||
19 | phrase "pin configuration node". | ||
20 | |||
21 | Qualcomm's pin configuration nodes act as a container for an abitrary number of | ||
22 | subnodes. Each of these subnodes represents some desired configuration for a | ||
23 | pin, a group, or a list of pins or groups. This configuration can include the | ||
24 | mux function to select on those pin(s)/group(s), and various pin configuration | ||
25 | parameters, such as pull-up, drive strength, etc. | ||
26 | |||
27 | The name of each subnode is not important; all subnodes should be enumerated | ||
28 | and processed purely based on their content. | ||
29 | |||
30 | Each subnode only affects those parameters that are explicitly listed. In | ||
31 | other words, a subnode that lists a mux function but no pin configuration | ||
32 | parameters implies no information about any pin configuration parameters. | ||
33 | Similarly, a pin subnode that describes a pullup parameter implies no | ||
34 | information about e.g. the mux function. | ||
35 | |||
36 | |||
37 | The following generic properties as defined in pinctrl-bindings.txt are valid | ||
38 | to specify in a pin configuration subnode: | ||
39 | pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength. | ||
40 | |||
41 | Non-empty subnodes must specify the 'pins' property. | ||
42 | Note that not all properties are valid for all pins. | ||
43 | |||
44 | |||
45 | Valid values for qcom,pins are: | ||
46 | gpio0-gpio145 | ||
47 | Supports mux, bias and drive-strength | ||
48 | |||
49 | sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data | ||
50 | Supports bias and drive-strength | ||
51 | |||
52 | Valid values for qcom,function are: | ||
53 | blsp_i2c2, blsp_i2c6, blsp_i2c11, blsp_spi1, blsp_uart2, blsp_uart8, slimbus | ||
54 | |||
55 | (Note that this is not yet the complete list of functions) | ||
56 | |||
57 | |||
58 | |||
59 | Example: | ||
60 | |||
61 | msmgpio: pinctrl@fd510000 { | ||
62 | compatible = "qcom,msm8974-pinctrl"; | ||
63 | reg = <0xfd510000 0x4000>; | ||
64 | |||
65 | gpio-controller; | ||
66 | #gpio-cells = <2>; | ||
67 | interrupt-controller; | ||
68 | #interrupt-cells = <2>; | ||
69 | interrupts = <0 208 0>; | ||
70 | |||
71 | pinctrl-names = "default"; | ||
72 | pinctrl-0 = <&uart2_default>; | ||
73 | |||
74 | uart2_default: uart2_default { | ||
75 | mux { | ||
76 | qcom,pins = "gpio4", "gpio5"; | ||
77 | qcom,function = "blsp_uart2"; | ||
78 | }; | ||
79 | |||
80 | tx { | ||
81 | qcom,pins = "gpio4"; | ||
82 | drive-strength = <4>; | ||
83 | bias-disable; | ||
84 | }; | ||
85 | |||
86 | rx { | ||
87 | qcom,pins = "gpio5"; | ||
88 | drive-strength = <2>; | ||
89 | bias-pull-up; | ||
90 | }; | ||
91 | }; | ||
92 | }; | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt index d5dac7b843a9..35d2e1f186f0 100644 --- a/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt | |||
@@ -26,6 +26,11 @@ Optional properties: | |||
26 | - #gpio-range-cells: Mandatory when the PFC doesn't handle GPIO, forbidden | 26 | - #gpio-range-cells: Mandatory when the PFC doesn't handle GPIO, forbidden |
27 | otherwise. Should be 3. | 27 | otherwise. Should be 3. |
28 | 28 | ||
29 | - interrupts-extended: Specify the interrupts associated with external | ||
30 | IRQ pins. This property is mandatory when the PFC handles GPIOs and | ||
31 | forbidden otherwise. When specified, it must contain one interrupt per | ||
32 | external IRQ, sorted by external IRQ number. | ||
33 | |||
29 | The PFC node also acts as a container for pin configuration nodes. Please refer | 34 | The PFC node also acts as a container for pin configuration nodes. Please refer |
30 | to pinctrl-bindings.txt in this directory for the definition of the term "pin | 35 | to pinctrl-bindings.txt in this directory for the definition of the term "pin |
31 | configuration node" and for the common pinctrl bindings used by client devices. | 36 | configuration node" and for the common pinctrl bindings used by client devices. |
@@ -103,6 +108,15 @@ Example 1: SH73A0 (SH-Mobile AG5) pin controller node | |||
103 | <0xe605801c 0x1c>; | 108 | <0xe605801c 0x1c>; |
104 | gpio-controller; | 109 | gpio-controller; |
105 | #gpio-cells = <2>; | 110 | #gpio-cells = <2>; |
111 | interrupts-extended = | ||
112 | <&irqpin0 0 0>, <&irqpin0 1 0>, <&irqpin0 2 0>, <&irqpin0 3 0>, | ||
113 | <&irqpin0 4 0>, <&irqpin0 5 0>, <&irqpin0 6 0>, <&irqpin0 7 0>, | ||
114 | <&irqpin1 0 0>, <&irqpin1 1 0>, <&irqpin1 2 0>, <&irqpin1 3 0>, | ||
115 | <&irqpin1 4 0>, <&irqpin1 5 0>, <&irqpin1 6 0>, <&irqpin1 7 0>, | ||
116 | <&irqpin2 0 0>, <&irqpin2 1 0>, <&irqpin2 2 0>, <&irqpin2 3 0>, | ||
117 | <&irqpin2 4 0>, <&irqpin2 5 0>, <&irqpin2 6 0>, <&irqpin2 7 0>, | ||
118 | <&irqpin3 0 0>, <&irqpin3 1 0>, <&irqpin3 2 0>, <&irqpin3 3 0>, | ||
119 | <&irqpin3 4 0>, <&irqpin3 5 0>, <&irqpin3 6 0>, <&irqpin3 7 0>; | ||
106 | }; | 120 | }; |
107 | 121 | ||
108 | Example 2: A GPIO LED node that references a GPIO | 122 | Example 2: A GPIO LED node that references a GPIO |
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt index a7929cb47e7c..23f1590f49fe 100644 --- a/Documentation/pinctrl.txt +++ b/Documentation/pinctrl.txt | |||
@@ -18,7 +18,7 @@ Definition of PIN CONTROLLER: | |||
18 | 18 | ||
19 | - A pin controller is a piece of hardware, usually a set of registers, that | 19 | - A pin controller is a piece of hardware, usually a set of registers, that |
20 | can control PINs. It may be able to multiplex, bias, set load capacitance, | 20 | can control PINs. It may be able to multiplex, bias, set load capacitance, |
21 | set drive strength etc for individual pins or groups of pins. | 21 | set drive strength, etc. for individual pins or groups of pins. |
22 | 22 | ||
23 | Definition of PIN: | 23 | Definition of PIN: |
24 | 24 | ||
@@ -90,7 +90,7 @@ selected drivers, you need to select them from your machine's Kconfig entry, | |||
90 | since these are so tightly integrated with the machines they are used on. | 90 | since these are so tightly integrated with the machines they are used on. |
91 | See for example arch/arm/mach-u300/Kconfig for an example. | 91 | See for example arch/arm/mach-u300/Kconfig for an example. |
92 | 92 | ||
93 | Pins usually have fancier names than this. You can find these in the dataheet | 93 | Pins usually have fancier names than this. You can find these in the datasheet |
94 | for your chip. Notice that the core pinctrl.h file provides a fancy macro | 94 | for your chip. Notice that the core pinctrl.h file provides a fancy macro |
95 | called PINCTRL_PIN() to create the struct entries. As you can see I enumerated | 95 | called PINCTRL_PIN() to create the struct entries. As you can see I enumerated |
96 | the pins from 0 in the upper left corner to 63 in the lower right corner. | 96 | the pins from 0 in the upper left corner to 63 in the lower right corner. |
@@ -185,7 +185,7 @@ static struct pinctrl_desc foo_desc = { | |||
185 | }; | 185 | }; |
186 | 186 | ||
187 | The pin control subsystem will call the .get_groups_count() function to | 187 | The pin control subsystem will call the .get_groups_count() function to |
188 | determine total number of legal selectors, then it will call the other functions | 188 | determine the total number of legal selectors, then it will call the other functions |
189 | to retrieve the name and pins of the group. Maintaining the data structure of | 189 | to retrieve the name and pins of the group. Maintaining the data structure of |
190 | the groups is up to the driver, this is just a simple example - in practice you | 190 | the groups is up to the driver, this is just a simple example - in practice you |
191 | may need more entries in your group structure, for example specific register | 191 | may need more entries in your group structure, for example specific register |
@@ -195,7 +195,7 @@ ranges associated with each group and so on. | |||
195 | Pin configuration | 195 | Pin configuration |
196 | ================= | 196 | ================= |
197 | 197 | ||
198 | Pins can sometimes be software-configured in an various ways, mostly related | 198 | Pins can sometimes be software-configured in various ways, mostly related |
199 | to their electronic properties when used as inputs or outputs. For example you | 199 | to their electronic properties when used as inputs or outputs. For example you |
200 | may be able to make an output pin high impedance, or "tristate" meaning it is | 200 | may be able to make an output pin high impedance, or "tristate" meaning it is |
201 | effectively disconnected. You may be able to connect an input pin to VDD or GND | 201 | effectively disconnected. You may be able to connect an input pin to VDD or GND |
@@ -291,7 +291,7 @@ Since the pin controller subsystem have its pinspace local to the pin | |||
291 | controller we need a mapping so that the pin control subsystem can figure out | 291 | controller we need a mapping so that the pin control subsystem can figure out |
292 | which pin controller handles control of a certain GPIO pin. Since a single | 292 | which pin controller handles control of a certain GPIO pin. Since a single |
293 | pin controller may be muxing several GPIO ranges (typically SoCs that have | 293 | pin controller may be muxing several GPIO ranges (typically SoCs that have |
294 | one set of pins but internally several GPIO silicon blocks, each modelled as | 294 | one set of pins, but internally several GPIO silicon blocks, each modelled as |
295 | a struct gpio_chip) any number of GPIO ranges can be added to a pin controller | 295 | a struct gpio_chip) any number of GPIO ranges can be added to a pin controller |
296 | instance like this: | 296 | instance like this: |
297 | 297 | ||
@@ -373,9 +373,9 @@ will be called on that specific pin controller. | |||
373 | 373 | ||
374 | For all functionalities dealing with pin biasing, pin muxing etc, the pin | 374 | For all functionalities dealing with pin biasing, pin muxing etc, the pin |
375 | controller subsystem will look up the corresponding pin number from the passed | 375 | controller subsystem will look up the corresponding pin number from the passed |
376 | in gpio number, and use the range's internals to retrive a pin number. After | 376 | in gpio number, and use the range's internals to retrieve a pin number. After |
377 | that, the subsystem passes it on to the pin control driver, so the driver | 377 | that, the subsystem passes it on to the pin control driver, so the driver |
378 | will get an pin number into its handled number range. Further it is also passed | 378 | will get a pin number into its handled number range. Further it is also passed |
379 | the range ID value, so that the pin controller knows which range it should | 379 | the range ID value, so that the pin controller knows which range it should |
380 | deal with. | 380 | deal with. |
381 | 381 | ||
@@ -430,8 +430,8 @@ pins you see some will be taken by things like a few VCC and GND to feed power | |||
430 | to the chip, and quite a few will be taken by large ports like an external | 430 | to the chip, and quite a few will be taken by large ports like an external |
431 | memory interface. The remaining pins will often be subject to pin multiplexing. | 431 | memory interface. The remaining pins will often be subject to pin multiplexing. |
432 | 432 | ||
433 | The example 8x8 PGA package above will have pin numbers 0 thru 63 assigned to | 433 | The example 8x8 PGA package above will have pin numbers 0 through 63 assigned |
434 | its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using | 434 | to its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using |
435 | pinctrl_register_pins() and a suitable data set as shown earlier. | 435 | pinctrl_register_pins() and a suitable data set as shown earlier. |
436 | 436 | ||
437 | In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port | 437 | In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port |
@@ -442,7 +442,7 @@ we cannot use the SPI port and I2C port at the same time. However in the inside | |||
442 | of the package the silicon performing the SPI logic can alternatively be routed | 442 | of the package the silicon performing the SPI logic can alternatively be routed |
443 | out on pins { G4, G3, G2, G1 }. | 443 | out on pins { G4, G3, G2, G1 }. |
444 | 444 | ||
445 | On the botton row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something | 445 | On the bottom row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something |
446 | special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will | 446 | special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will |
447 | consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or | 447 | consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or |
448 | { A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI | 448 | { A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI |
@@ -549,7 +549,7 @@ Assumptions: | |||
549 | 549 | ||
550 | We assume that the number of possible function maps to pin groups is limited by | 550 | We assume that the number of possible function maps to pin groups is limited by |
551 | the hardware. I.e. we assume that there is no system where any function can be | 551 | the hardware. I.e. we assume that there is no system where any function can be |
552 | mapped to any pin, like in a phone exchange. So the available pins groups for | 552 | mapped to any pin, like in a phone exchange. So the available pin groups for |
553 | a certain function will be limited to a few choices (say up to eight or so), | 553 | a certain function will be limited to a few choices (say up to eight or so), |
554 | not hundreds or any amount of choices. This is the characteristic we have found | 554 | not hundreds or any amount of choices. This is the characteristic we have found |
555 | by inspecting available pinmux hardware, and a necessary assumption since we | 555 | by inspecting available pinmux hardware, and a necessary assumption since we |
@@ -564,7 +564,7 @@ The pinmux core takes care of preventing conflicts on pins and calling | |||
564 | the pin controller driver to execute different settings. | 564 | the pin controller driver to execute different settings. |
565 | 565 | ||
566 | It is the responsibility of the pinmux driver to impose further restrictions | 566 | It is the responsibility of the pinmux driver to impose further restrictions |
567 | (say for example infer electronic limitations due to load etc) to determine | 567 | (say for example infer electronic limitations due to load, etc.) to determine |
568 | whether or not the requested function can actually be allowed, and in case it | 568 | whether or not the requested function can actually be allowed, and in case it |
569 | is possible to perform the requested mux setting, poke the hardware so that | 569 | is possible to perform the requested mux setting, poke the hardware so that |
570 | this happens. | 570 | this happens. |
@@ -755,7 +755,7 @@ Pin control interaction with the GPIO subsystem | |||
755 | Note that the following implies that the use case is to use a certain pin | 755 | Note that the following implies that the use case is to use a certain pin |
756 | from the Linux kernel using the API in <linux/gpio.h> with gpio_request() | 756 | from the Linux kernel using the API in <linux/gpio.h> with gpio_request() |
757 | and similar functions. There are cases where you may be using something | 757 | and similar functions. There are cases where you may be using something |
758 | that your datasheet calls "GPIO mode" but actually is just an electrical | 758 | that your datasheet calls "GPIO mode", but actually is just an electrical |
759 | configuration for a certain device. See the section below named | 759 | configuration for a certain device. See the section below named |
760 | "GPIO mode pitfalls" for more details on this scenario. | 760 | "GPIO mode pitfalls" for more details on this scenario. |
761 | 761 | ||
@@ -871,7 +871,7 @@ hardware and shall be put into different subsystems: | |||
871 | 871 | ||
872 | - Registers (or fields within registers) that control muxing of signals | 872 | - Registers (or fields within registers) that control muxing of signals |
873 | from various other HW blocks (e.g. I2C, MMC, or GPIO) onto pins should | 873 | from various other HW blocks (e.g. I2C, MMC, or GPIO) onto pins should |
874 | be exposed through the pinctrl subssytem, as mux functions. | 874 | be exposed through the pinctrl subsystem, as mux functions. |
875 | 875 | ||
876 | - Registers (or fields within registers) that control GPIO functionality | 876 | - Registers (or fields within registers) that control GPIO functionality |
877 | such as setting a GPIO's output value, reading a GPIO's input value, or | 877 | such as setting a GPIO's output value, reading a GPIO's input value, or |
@@ -895,7 +895,7 @@ Example: a pin is usually muxed in to be used as a UART TX line. But during | |||
895 | system sleep, we need to put this pin into "GPIO mode" and ground it. | 895 | system sleep, we need to put this pin into "GPIO mode" and ground it. |
896 | 896 | ||
897 | If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start | 897 | If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start |
898 | to think that you need to come up with something real complex, that the | 898 | to think that you need to come up with something really complex, that the |
899 | pin shall be used for UART TX and GPIO at the same time, that you will grab | 899 | pin shall be used for UART TX and GPIO at the same time, that you will grab |
900 | a pin control handle and set it to a certain state to enable UART TX to be | 900 | a pin control handle and set it to a certain state to enable UART TX to be |
901 | muxed in, then twist it over to GPIO mode and use gpio_direction_output() | 901 | muxed in, then twist it over to GPIO mode and use gpio_direction_output() |
@@ -964,12 +964,12 @@ GPIO mode. | |||
964 | This will give the desired effect without any bogus interaction with the | 964 | This will give the desired effect without any bogus interaction with the |
965 | GPIO subsystem. It is just an electrical configuration used by that device | 965 | GPIO subsystem. It is just an electrical configuration used by that device |
966 | when going to sleep, it might imply that the pin is set into something the | 966 | when going to sleep, it might imply that the pin is set into something the |
967 | datasheet calls "GPIO mode" but that is not the point: it is still used | 967 | datasheet calls "GPIO mode", but that is not the point: it is still used |
968 | by that UART device to control the pins that pertain to that very UART | 968 | by that UART device to control the pins that pertain to that very UART |
969 | driver, putting them into modes needed by the UART. GPIO in the Linux | 969 | driver, putting them into modes needed by the UART. GPIO in the Linux |
970 | kernel sense are just some 1-bit line, and is a different use case. | 970 | kernel sense are just some 1-bit line, and is a different use case. |
971 | 971 | ||
972 | How the registers are poked to attain the push/pull and output low | 972 | How the registers are poked to attain the push or pull, and output low |
973 | configuration and the muxing of the "u0" or "gpio-mode" group onto these | 973 | configuration and the muxing of the "u0" or "gpio-mode" group onto these |
974 | pins is a question for the driver. | 974 | pins is a question for the driver. |
975 | 975 | ||
@@ -977,7 +977,7 @@ Some datasheets will be more helpful and refer to the "GPIO mode" as | |||
977 | "low power mode" rather than anything to do with GPIO. This often means | 977 | "low power mode" rather than anything to do with GPIO. This often means |
978 | the same thing electrically speaking, but in this latter case the | 978 | the same thing electrically speaking, but in this latter case the |
979 | software engineers will usually quickly identify that this is some | 979 | software engineers will usually quickly identify that this is some |
980 | specific muxing/configuration rather than anything related to the GPIO | 980 | specific muxing or configuration rather than anything related to the GPIO |
981 | API. | 981 | API. |
982 | 982 | ||
983 | 983 | ||
@@ -1024,8 +1024,7 @@ up the device struct (just like with clockdev or regulators). The function name | |||
1024 | must match a function provided by the pinmux driver handling this pin range. | 1024 | must match a function provided by the pinmux driver handling this pin range. |
1025 | 1025 | ||
1026 | As you can see we may have several pin controllers on the system and thus | 1026 | As you can see we may have several pin controllers on the system and thus |
1027 | we need to specify which one of them that contain the functions we wish | 1027 | we need to specify which one of them contains the functions we wish to map. |
1028 | to map. | ||
1029 | 1028 | ||
1030 | You register this pinmux mapping to the pinmux subsystem by simply: | 1029 | You register this pinmux mapping to the pinmux subsystem by simply: |
1031 | 1030 | ||
@@ -1254,10 +1253,10 @@ The semantics of the pinctrl APIs are: | |||
1254 | pinctrl_get(). | 1253 | pinctrl_get(). |
1255 | 1254 | ||
1256 | - pinctrl_lookup_state() is called in process context to obtain a handle to a | 1255 | - pinctrl_lookup_state() is called in process context to obtain a handle to a |
1257 | specific state for a the client device. This operation may be slow too. | 1256 | specific state for a client device. This operation may be slow, too. |
1258 | 1257 | ||
1259 | - pinctrl_select_state() programs pin controller hardware according to the | 1258 | - pinctrl_select_state() programs pin controller hardware according to the |
1260 | definition of the state as given by the mapping table. In theory this is a | 1259 | definition of the state as given by the mapping table. In theory, this is a |
1261 | fast-path operation, since it only involved blasting some register settings | 1260 | fast-path operation, since it only involved blasting some register settings |
1262 | into hardware. However, note that some pin controllers may have their | 1261 | into hardware. However, note that some pin controllers may have their |
1263 | registers on a slow/IRQ-based bus, so client devices should not assume they | 1262 | registers on a slow/IRQ-based bus, so client devices should not assume they |