8299662c2c0960ed463cb405aa03022a7e1deca8
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / pinctrl / pinctrl-mt8195.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/pinctrl/pinctrl-mt8195.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Mediatek MT8195 Pin Controller
8
9 maintainers:
10   - Sean Wang <sean.wang@mediatek.com>
11
12 description: |
13   The Mediatek's Pin controller is used to control SoC pins.
14
15 properties:
16   compatible:
17     const: mediatek,mt8195-pinctrl
18
19   gpio-controller: true
20
21   '#gpio-cells':
22     description: |
23       Number of cells in GPIO specifier. Since the generic GPIO binding is used,
24       the amount of cells must be specified as 2. See the below
25       mentioned gpio binding representation for description of particular cells.
26     const: 2
27
28   gpio-ranges:
29     description: gpio valid number range.
30     maxItems: 1
31
32   reg:
33     description: |
34       Physical address base for gpio base registers. There are 8 GPIO
35       physical address base in mt8195.
36     maxItems: 8
37
38   reg-names:
39     description: |
40       Gpio base register names.
41     maxItems: 8
42
43   interrupt-controller: true
44
45   '#interrupt-cells':
46     const: 2
47
48   interrupts:
49     description: The interrupt outputs to sysirq.
50     maxItems: 1
51
52   mediatek,rsel_resistance_in_si_unit:
53     type: boolean
54     description: |
55       Identifying i2c pins pull up/down type which is RSEL. It can support
56       RSEL define or si unit value(ohm) to set different resistance.
57
58 # PIN CONFIGURATION NODES
59 patternProperties:
60   '-pins$':
61     type: object
62     additionalProperties: false
63     patternProperties:
64       '^pins':
65         type: object
66         additionalProperties: false
67         description: |
68           A pinctrl node should contain at least one subnodes representing the
69           pinctrl groups available on the machine. Each subnode will list the
70           pins it needs, and how they should be configured, with regard to muxer
71           configuration, pullups, drive strength, input enable/disable and
72           input schmitt.
73           An example of using macro:
74           pincontroller {
75             /* GPIO0 set as multifunction GPIO0 */
76             gpio-pins {
77               pins {
78                 pinmux = <PINMUX_GPIO0__FUNC_GPIO0>;
79               }
80             };
81             /* GPIO8 set as multifunction SDA0 */
82             i2c0-pins {
83               pins {
84                 pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
85               }
86             };
87           };
88         $ref: "pinmux-node.yaml"
89
90         properties:
91           pinmux:
92             description: |
93               Integer array, represents gpio pin number and mux setting.
94               Supported pin number and mux varies for different SoCs, and are
95               defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h
96               directly.
97
98           drive-strength:
99             enum: [2, 4, 6, 8, 10, 12, 14, 16]
100
101           bias-pull-down:
102             oneOf:
103               - type: boolean
104               - enum: [100, 101, 102, 103]
105                 description: mt8195 pull down PUPD/R0/R1 type define value.
106               - enum: [200, 201, 202, 203, 204, 205, 206, 207]
107                 description: mt8195 pull down RSEL type define value.
108               - enum: [75000, 5000]
109                 description: mt8195 pull down RSEL type si unit value(ohm).
110             description: |
111               For pull down type is normal, it don't need add RSEL & R1R0 define
112               and resistance value.
113               For pull down type is PUPD/R0/R1 type, it can add R1R0 define to
114               set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
115               "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
116               "MTK_PUPD_SET_R1R0_11" define in mt8195.
117               For pull down type is RSEL, it can add RSEL define & resistance
118               value(ohm) to set different resistance by identifying property
119               "mediatek,rsel_resistance_in_si_unit".
120               It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
121               & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011"
122               & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101"
123               & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111"
124               define in mt8195. It can also support resistance value(ohm)
125               "75000" & "5000" in mt8195.
126
127               An example of using RSEL define:
128               pincontroller {
129                 i2c0_pin {
130                   pins {
131                     pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
132                     bias-pull-down = <MTK_PULL_SET_RSEL_001>;
133                   }
134                 };
135               };
136               An example of using si unit resistance value(ohm):
137               &pio {
138                 mediatek,rsel_resistance_in_si_unit;
139               }
140               pincontroller {
141                 i2c0_pin {
142                   pins {
143                     pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
144                     bias-pull-down = <75000>;
145                   }
146                 };
147               };
148
149           bias-pull-up:
150             oneOf:
151               - type: boolean
152               - enum: [100, 101, 102, 103]
153                 description: mt8195 pull up PUPD/R0/R1 type define value.
154               - enum: [200, 201, 202, 203, 204, 205, 206, 207]
155                 description: mt8195 pull up RSEL type define value.
156               - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000]
157                 description: mt8195 pull up RSEL type si unit value(ohm).
158             description: |
159               For pull up type is normal, it don't need add RSEL & R1R0 define
160               and resistance value.
161               For pull up type is PUPD/R0/R1 type, it can add R1R0 define to
162               set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
163               "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
164               "MTK_PUPD_SET_R1R0_11" define in mt8195.
165               For pull up type is RSEL, it can add RSEL define & resistance
166               value(ohm) to set different resistance by identifying property
167               "mediatek,rsel_resistance_in_si_unit".
168               It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
169               & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011"
170               & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101"
171               & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111"
172               define in mt8195. It can also support resistance value(ohm)
173               "1000" & "1500" & "2000" & "3000" & "4000" & "5000" & "10000" &
174               "75000" in mt8195.
175               An example of using RSEL define:
176               pincontroller {
177                 i2c0-pins {
178                   pins {
179                     pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
180                     bias-pull-up = <MTK_PULL_SET_RSEL_001>;
181                   }
182                 };
183               };
184               An example of using si unit resistance value(ohm):
185               &pio {
186                 mediatek,rsel_resistance_in_si_unit;
187               }
188               pincontroller {
189                 i2c0-pins {
190                   pins {
191                     pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
192                     bias-pull-up = <1000>;
193                   }
194                 };
195               };
196
197           bias-disable: true
198
199           output-high: true
200
201           output-low: true
202
203           input-enable: true
204
205           input-disable: true
206
207           input-schmitt-enable: true
208
209           input-schmitt-disable: true
210
211         required:
212           - pinmux
213
214 allOf:
215   - $ref: "pinctrl.yaml#"
216
217 required:
218   - compatible
219   - reg
220   - interrupts
221   - interrupt-controller
222   - '#interrupt-cells'
223   - gpio-controller
224   - '#gpio-cells'
225   - gpio-ranges
226
227 additionalProperties: false
228
229 examples:
230   - |
231     #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
232     #include <dt-bindings/interrupt-controller/arm-gic.h>
233     #
234     pio: pinctrl@10005000 {
235       compatible = "mediatek,mt8195-pinctrl";
236       reg = <0x10005000 0x1000>,
237             <0x11d10000 0x1000>,
238             <0x11d30000 0x1000>,
239             <0x11d40000 0x1000>,
240             <0x11e20000 0x1000>,
241             <0x11eb0000 0x1000>,
242             <0x11f40000 0x1000>,
243             <0x1000b000 0x1000>;
244       reg-names = "iocfg0", "iocfg_bm", "iocfg_bl",
245                   "iocfg_br", "iocfg_lm", "iocfg_rb",
246                   "iocfg_tl", "eint";
247       gpio-controller;
248       #gpio-cells = <2>;
249       gpio-ranges = <&pio 0 0 144>;
250       interrupt-controller;
251       interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>;
252       #interrupt-cells = <2>;
253
254       pio-pins {
255         pins {
256           pinmux = <PINMUX_GPIO0__FUNC_GPIO0>;
257           output-low;
258         };
259       };
260
261       spi0-pins {
262         pins-spi {
263           pinmux = <PINMUX_GPIO132__FUNC_SPIM0_CSB>,
264                    <PINMUX_GPIO134__FUNC_SPIM0_MO>,
265                    <PINMUX_GPIO133__FUNC_SPIM0_CLK>;
266           bias-disable;
267         };
268         pins-spi-mi {
269           pinmux = <PINMUX_GPIO135__FUNC_SPIM0_MI>;
270           bias-pull-down;
271         };
272       };
273     };