blob: 2c81e45f1374ccd7b5b79c1bb2872639c4d04652 [file] [log] [blame]
Tony Lindgren8b8b0912012-07-10 02:05:46 -07001One-register-per-pin type device tree based pinctrl driver
2
3Required properties:
4- compatible : "pinctrl-single"
5
6- reg : offset and length of the register set for the mux registers
7
8- pinctrl-single,register-width : pinmux register access width in bits
9
10- pinctrl-single,function-mask : mask of allowed pinmux function bits
11 in the pinmux register
12
13Optional properties:
14- pinctrl-single,function-off : function off mode for disabled state if
15 available and same for all registers; if not specified, disabling of
16 pin functions is ignored
Peter Ujfalusi9e605cb2012-09-11 11:54:24 +030017- pinctrl-single,bit-per-mux : boolean to indicate that one register controls
18 more than one pin
Tony Lindgren8b8b0912012-07-10 02:05:46 -070019
Peter Ujfalusi9e605cb2012-09-11 11:54:24 +030020This driver assumes that there is only one register for each pin (unless the
21pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as
22specified in the pinctrl-bindings.txt document in this directory.
Tony Lindgren8b8b0912012-07-10 02:05:46 -070023
24The pin configuration nodes for pinctrl-single are specified as pinctrl
25register offset and value pairs using pinctrl-single,pins. Only the bits
26specified in pinctrl-single,function-mask are updated. For example, setting
27a pin for a device could be done with:
28
29 pinctrl-single,pins = <0xdc 0x118>;
30
31Where 0xdc is the offset from the pinctrl register base address for the
32device pinctrl register, and 0x118 contains the desired value of the
33pinctrl register. See the device example and static board pins example
34below for more information.
35
Peter Ujfalusi9e605cb2012-09-11 11:54:24 +030036In case when one register changes more than one pin's mux the
37pinctrl-single,bits need to be used which takes three parameters:
38
39 pinctrl-single,bits = <0xdc 0x18, 0xff>;
40
41Where 0xdc is the offset from the pinctrl register base address for the
42device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to
43be used when applying this change to the register.
44
Tony Lindgren8b8b0912012-07-10 02:05:46 -070045Example:
46
47/* SoC common file */
48
49/* first controller instance for pins in core domain */
50pmx_core: pinmux@4a100040 {
51 compatible = "pinctrl-single";
52 reg = <0x4a100040 0x0196>;
53 #address-cells = <1>;
54 #size-cells = <0>;
55 pinctrl-single,register-width = <16>;
56 pinctrl-single,function-mask = <0xffff>;
57};
58
59/* second controller instance for pins in wkup domain */
60pmx_wkup: pinmux@4a31e040 {
61 compatible = "pinctrl-single;
62 reg = <0x4a31e040 0x0038>;
63 #address-cells = <1>;
64 #size-cells = <0>;
65 pinctrl-single,register-width = <16>;
66 pinctrl-single,function-mask = <0xffff>;
67};
68
Peter Ujfalusi9e605cb2012-09-11 11:54:24 +030069control_devconf0: pinmux@48002274 {
70 compatible = "pinctrl-single";
71 reg = <0x48002274 4>; /* Single register */
72 #address-cells = <1>;
73 #size-cells = <0>;
74 pinctrl-single,bit-per-mux;
75 pinctrl-single,register-width = <32>;
76 pinctrl-single,function-mask = <0x5F>;
77};
Tony Lindgren8b8b0912012-07-10 02:05:46 -070078
79/* board specific .dts file */
80
81&pmx_core {
82
83 /*
84 * map all board specific static pins enabled by the pinctrl driver
85 * itself during the boot (or just set them up in the bootloader)
86 */
87 pinctrl-names = "default";
88 pinctrl-0 = <&board_pins>;
89
90 board_pins: pinmux_board_pins {
91 pinctrl-single,pins = <
92 0x6c 0xf
93 0x6e 0xf
94 0x70 0xf
95 0x72 0xf
96 >;
97 };
98
99 /* map uart2 pins */
100 uart2_pins: pinmux_uart2_pins {
101 pinctrl-single,pins = <
102 0xd8 0x118
103 0xda 0
104 0xdc 0x118
105 0xde 0
106 >;
107 };
108};
109
Peter Ujfalusi9e605cb2012-09-11 11:54:24 +0300110&control_devconf0 {
111 mcbsp1_pins: pinmux_mcbsp1_pins {
112 pinctrl-single,bits = <
113 0x00 0x18 0x18 /* FSR/CLKR signal from FSX/CLKX pin */
114 >;
115 };
116
117 mcbsp2_clks_pins: pinmux_mcbsp2_clks_pins {
118 pinctrl-single,bits = <
119 0x00 0x40 0x40 /* McBSP2 CLKS from McBSP_CLKS pin */
120 >;
121 };
122
123};
124
Tony Lindgren8b8b0912012-07-10 02:05:46 -0700125&uart2 {
126 pinctrl-names = "default";
127 pinctrl-0 = <&uart2_pins>;
128};