Merge remote-tracking branches 'asoc/topic/cs35l35', 'asoc/topic/cs53l30', 'asoc...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / pinctrl / rockchip,pinctrl.txt
1 * Rockchip Pinmux Controller
2
3 The Rockchip Pinmux Controller, enables the IC
4 to share one PAD to several functional blocks. The sharing is done by
5 multiplexing the PAD input/output signals. For each PAD there are several
6 muxing options with option 0 being the use as a GPIO.
7
8 Please refer to pinctrl-bindings.txt in this directory for details of the
9 common pinctrl bindings used by client devices, including the meaning of the
10 phrase "pin configuration node".
11
12 The Rockchip pin configuration node is a node of a group of pins which can be
13 used for a specific device or function. This node represents both mux and
14 config of the pins in that group. The 'pins' selects the function mode(also
15 named pin mode) this pin can work on and the 'config' configures various pad
16 settings such as pull-up, etc.
17
18 The pins are grouped into up to 5 individual pin banks which need to be
19 defined as gpio sub-nodes of the pinmux controller.
20
21 Required properties for iomux controller:
22   - compatible: one of "rockchip,rk1108-pinctrl", "rockchip,rk2928-pinctrl"
23                        "rockchip,rk3066a-pinctrl", "rockchip,rk3066b-pinctrl"
24                        "rockchip,rk3188-pinctrl", "rockchip,rk3228-pinctrl"
25                        "rockchip,rk3288-pinctrl", "rockchip,rk3368-pinctrl"
26                        "rockchip,rk3399-pinctrl"
27   - rockchip,grf: phandle referencing a syscon providing the
28          "general register files"
29
30 Optional properties for iomux controller:
31   - rockchip,pmu: phandle referencing a syscon providing the pmu registers
32          as some SoCs carry parts of the iomux controller registers there.
33          Required for at least rk3188 and rk3288. On the rk3368 this should
34          point to the PMUGRF syscon.
35
36 Deprecated properties for iomux controller:
37   - reg: first element is the general register space of the iomux controller
38          It should be large enough to contain also separate pull registers.
39          second element is the separate pull register space of the rk3188.
40          Use rockchip,grf and rockchip,pmu described above instead.
41
42 Required properties for gpio sub nodes:
43   - compatible: "rockchip,gpio-bank"
44   - reg: register of the gpio bank (different than the iomux registerset)
45   - interrupts: base interrupt of the gpio bank in the interrupt controller
46   - clocks: clock that drives this bank
47   - gpio-controller: identifies the node as a gpio controller and pin bank.
48   - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO
49     binding is used, the amount of cells must be specified as 2. See generic
50     GPIO binding documentation for description of particular cells.
51   - interrupt-controller: identifies the controller node as interrupt-parent.
52   - #interrupt-cells: the value of this property should be 2 and the interrupt
53     cells should use the standard two-cell scheme described in
54     bindings/interrupt-controller/interrupts.txt
55
56 Deprecated properties for gpio sub nodes:
57   - compatible: "rockchip,rk3188-gpio-bank0"
58   - reg: second element: separate pull register for rk3188 bank0, use
59          rockchip,pmu described above instead
60
61 Required properties for pin configuration node:
62   - rockchip,pins: 3 integers array, represents a group of pins mux and config
63     setting. The format is rockchip,pins = <PIN_BANK PIN_BANK_IDX MUX &phandle>.
64     The MUX 0 means gpio and MUX 1 to N mean the specific device function.
65     The phandle of a node containing the generic pinconfig options
66     to use, as described in pinctrl-bindings.txt in this directory.
67
68 Examples:
69
70 #include <dt-bindings/pinctrl/rockchip.h>
71
72 ...
73
74 pinctrl@20008000 {
75         compatible = "rockchip,rk3066a-pinctrl";
76         rockchip,grf = <&grf>;
77
78         #address-cells = <1>;
79         #size-cells = <1>;
80         ranges;
81
82         gpio0: gpio0@20034000 {
83                 compatible = "rockchip,gpio-bank";
84                 reg = <0x20034000 0x100>;
85                 interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
86                 clocks = <&clk_gates8 9>;
87
88                 gpio-controller;
89                 #gpio-cells = <2>;
90
91                 interrupt-controller;
92                 #interrupt-cells = <2>;
93         };
94
95         ...
96
97         pcfg_pull_default: pcfg_pull_default {
98                 bias-pull-pin-default
99         };
100
101         uart2 {
102                 uart2_xfer: uart2-xfer {
103                         rockchip,pins = <RK_GPIO1 8 1 &pcfg_pull_default>,
104                                         <RK_GPIO1 9 1 &pcfg_pull_default>;
105                 };
106         };
107 };
108
109 uart2: serial@20064000 {
110         compatible = "snps,dw-apb-uart";
111         reg = <0x20064000 0x400>;
112         interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
113         reg-shift = <2>;
114         reg-io-width = <1>;
115         clocks = <&mux_uart2>;
116         status = "okay";
117
118         pinctrl-names = "default";
119         pinctrl-0 = <&uart2_xfer>;
120 };
121
122 Example for rk3188:
123
124         pinctrl@20008000 {
125                 compatible = "rockchip,rk3188-pinctrl";
126                 rockchip,grf = <&grf>;
127                 rockchip,pmu = <&pmu>;
128                 #address-cells = <1>;
129                 #size-cells = <1>;
130                 ranges;
131
132                 gpio0: gpio0@0x2000a000 {
133                         compatible = "rockchip,rk3188-gpio-bank0";
134                         reg = <0x2000a000 0x100>;
135                         interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
136                         clocks = <&clk_gates8 9>;
137
138                         gpio-controller;
139                         #gpio-cells = <2>;
140
141                         interrupt-controller;
142                         #interrupt-cells = <2>;
143                 };
144
145                 gpio1: gpio1@0x2003c000 {
146                         compatible = "rockchip,gpio-bank";
147                         reg = <0x2003c000 0x100>;
148                         interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
149                         clocks = <&clk_gates8 10>;
150
151                         gpio-controller;
152                         #gpio-cells = <2>;
153
154                         interrupt-controller;
155                         #interrupt-cells = <2>;
156                 };
157
158                 ...
159
160         };