summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml
blob: 45024057031456306ba32188dfdaec1ab43d13f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/allwinner,sun4i-a10-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A10 Pin Controller

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

properties:
  "#gpio-cells":
    const: 3
    description:
      GPIO consumers must use three arguments, first the number of the
      bank, then the pin number inside that bank, and finally the GPIO
      flags.

  "#interrupt-cells":
    const: 3
    description:
      Interrupts consumers must use three arguments, first the number
      of the bank, then the pin number inside that bank, and finally
      the interrupts flags.

  compatible:
    enum:
      - allwinner,sun4i-a10-pinctrl
      - allwinner,sun5i-a10s-pinctrl
      - allwinner,sun5i-a13-pinctrl
      - allwinner,sun6i-a31-pinctrl
      - allwinner,sun6i-a31-r-pinctrl
      - allwinner,sun6i-a31s-pinctrl
      - allwinner,sun7i-a20-pinctrl
      - allwinner,sun8i-a23-pinctrl
      - allwinner,sun8i-a23-r-pinctrl
      - allwinner,sun8i-a33-pinctrl
      - allwinner,sun8i-a83t-pinctrl
      - allwinner,sun8i-a83t-r-pinctrl
      - allwinner,sun8i-h3-pinctrl
      - allwinner,sun8i-h3-r-pinctrl
      - allwinner,sun8i-r40-pinctrl
      - allwinner,sun8i-v3-pinctrl
      - allwinner,sun8i-v3s-pinctrl
      - allwinner,sun9i-a80-pinctrl
      - allwinner,sun9i-a80-r-pinctrl
      - allwinner,sun20i-d1-pinctrl
      - allwinner,sun50i-a64-pinctrl
      - allwinner,sun50i-a64-r-pinctrl
      - allwinner,sun50i-a100-pinctrl
      - allwinner,sun50i-a100-r-pinctrl
      - allwinner,sun50i-h5-pinctrl
      - allwinner,sun50i-h6-pinctrl
      - allwinner,sun50i-h6-r-pinctrl
      - allwinner,sun50i-h616-pinctrl
      - allwinner,sun50i-h616-r-pinctrl
      - allwinner,suniv-f1c100s-pinctrl
      - nextthing,gr8-pinctrl

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    maxItems: 8
    description:
      One interrupt per external interrupt bank supported on the
      controller, sorted by bank number ascending order.

  clocks:
    items:
      - description: Bus Clock
      - description: High Frequency Oscillator
      - description: Low Frequency Oscillator

  clock-names:
    items:
      - const: apb
      - const: hosc
      - const: losc

  gpio-controller: true
  interrupt-controller: true
  gpio-line-names: true

  input-debounce:
    description:
      Debouncing periods in microseconds, one period per interrupt
      bank found in the controller
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 8

patternProperties:
  # It's pretty scary, but the basic idea is that:
  #   - One node name can start with either s- or r- for PRCM nodes,
  #   - Then, the name itself can be any repetition of <string>- (to
  #     accommodate with nodes like uart4-rts-cts-pins), where each
  #     string can be either starting with 'p' but in a string longer
  #     than 3, or something that doesn't start with 'p',
  #   - Then, the bank name is optional and will be between pa and pg,
  #     pl or pm. Some pins groups that have several options will have
  #     the pin numbers then,
  #   - Finally, the name will end with either -pin or pins.

  "^([rs]-)?(([a-z0-9]{3,}|[a-oq-z][a-z0-9]*?)?-)+?(p[a-ilm][0-9]*?-)??pins?$":
    type: object

    properties:
      pins: true
      function: true
      bias-disable: true
      bias-pull-up: true
      bias-pull-down: true

      drive-strength:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [10, 20, 30, 40]

    required:
      - pins
      - function

    additionalProperties: false

  "^vcc-p[a-ilm]-supply$":
    description:
      Power supplies for pin banks.

required:
  - "#gpio-cells"
  - compatible
  - reg
  - clocks
  - clock-names
  - gpio-controller

allOf:
  # FIXME: We should have the pin bank supplies here, but not a lot of
  # boards are defining it at the moment so it would generate a lot of
  # warnings.

  - $ref: pinctrl.yaml#
  - if:
      not:
        properties:
          compatible:
            enum:
              - allwinner,sun50i-h616-r-pinctrl

    then:
      required:
        - "#interrupt-cells"
        - interrupts
        - interrupt-controller

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun50i-h616-pinctrl

    then:
      properties:
        interrupts:
          minItems: 8

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun50i-a100-pinctrl

    then:
      properties:
        interrupts:
          minItems: 7
          maxItems: 7

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun20i-d1-pinctrl

    then:
      properties:
        interrupts:
          minItems: 6
          maxItems: 6

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun9i-a80-pinctrl

    then:
      properties:
        interrupts:
          minItems: 5
          maxItems: 5

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun6i-a31-pinctrl
            - allwinner,sun6i-a31s-pinctrl
            - allwinner,sun50i-h6-pinctrl

    then:
      properties:
        interrupts:
          minItems: 4
          maxItems: 4

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun8i-a23-pinctrl
            - allwinner,sun8i-a83t-pinctrl
            - allwinner,sun50i-a64-pinctrl
            - allwinner,sun50i-h5-pinctrl
            - allwinner,suniv-f1c100s-pinctrl

    then:
      properties:
        interrupts:
          minItems: 3
          maxItems: 3

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun6i-a31-r-pinctrl
            - allwinner,sun8i-a33-pinctrl
            - allwinner,sun8i-h3-pinctrl
            - allwinner,sun8i-v3-pinctrl
            - allwinner,sun8i-v3s-pinctrl
            - allwinner,sun9i-a80-r-pinctrl
            - allwinner,sun50i-h6-r-pinctrl

    then:
      properties:
        interrupts:
          minItems: 2
          maxItems: 2

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun4i-a10-pinctrl
            - allwinner,sun5i-a10s-pinctrl
            - allwinner,sun5i-a13-pinctrl
            - allwinner,sun7i-a20-pinctrl
            - allwinner,sun8i-a23-r-pinctrl
            - allwinner,sun8i-a83t-r-pinctrl
            - allwinner,sun8i-h3-r-pinctrl
            - allwinner,sun8i-r40-pinctrl
            - allwinner,sun50i-a64-r-pinctrl
            - allwinner,sun50i-a100-r-pinctrl
            - nextthing,gr8-pinctrl

    then:
      properties:
        interrupts:
          minItems: 1
          maxItems: 1

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/sun5i-ccu.h>

    pio: pinctrl@1c20800 {
        compatible = "allwinner,sun5i-a13-pinctrl";
        reg = <0x01c20800 0x400>;
        interrupts = <28>;
        clocks = <&ccu CLK_APB0_PIO>, <&osc24M>, <&osc32k>;
        clock-names = "apb", "hosc", "losc";
        gpio-controller;
        interrupt-controller;
        #interrupt-cells = <3>;
        #gpio-cells = <3>;

        uart1_pe_pins: uart1-pe-pins {
            pins = "PE10", "PE11";
            function = "uart1";
        };

        uart1_pg_pins: uart1-pg-pins {
            pins = "PG3", "PG4";
            function = "uart1";
        };
    };