aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml
blob: aaf97124803f426034142dd0b59cd5403b2e6aef (plain) (blame)
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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/gpio-mxs.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Freescale MXS GPIO controller

maintainers:
  - Shawn Guo <shawnguo@kernel.org>

description: |
  The Freescale MXS GPIO controller is part of MXS PIN controller.
  The GPIOs are organized in port/bank, each port consists of 32 GPIOs.
  As the GPIO controller is embedded in the PIN controller and all the
  GPIO ports share the same IO space with PIN controller, the GPIO node
  will be represented as sub-nodes of MXS pinctrl node.

properties:
  compatible:
    items:
      - enum:
          - fsl,imx23-pinctrl
          - fsl,imx28-pinctrl
      # Over 10 years old devices, driver use simple-bus to probe child gpio
      # Devices. Keep it as it to be compatible existed dts files.
      - const: simple-bus

  '#address-cells':
    const: 1
  '#size-cells':
    const: 0

  reg:
    maxItems: 1

patternProperties:
  "^(?!gpio@)[^@]+@[0-9]+$":
    type: object
    properties:
      fsl,pinmux-ids:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        description: |
          An integer array.  Each integer in the array specify a pin
          with given mux function, with bank, pin and mux packed as below.

          [15..12] : bank number
          [11..4]  : pin number
          [3..0]   : mux selection

          This integer with mux selection packed is used as an entity by both group
          and config nodes to identify a pin.  The mux selection in the integer takes
          effects only on group node, and will get ignored by driver with config node,
          since config node is only meant to set up pin configurations.

          Valid values for these integers are listed below.

      reg:
        items:
          - description: |
              pin group index. NOTE: it is supposed wrong use reg property
              here. But it is over 10 years devices. Just keep it as it.

      fsl,drive-strength:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        description: |
          0: MXS_DRIVE_4mA
          1: MXS_DRIVE_8mA
          2: MXS_DRIVE_12mA
          3: MXS_DRIVE_16mA

      fsl,voltage:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1]
        description: |
          0: MXS_VOLTAGE_LOW  - 1.8 V
          1: MXS_VOLTAGE_HIGH - 3.3 V

      fsl,pull-up:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1]
        description: |
          0: MXS_PULL_DISABLE - Disable the internal pull-up
          1: MXS_PULL_ENABLE  - Enable the internal pull-up

          Note that when enabling the pull-up, the internal pad keeper gets disabled.
          Also, some pins doesn't have a pull up, in that case, setting the fsl,pull-up
          will only disable the internal pad keeper.

    required:
      - fsl,pinmux-ids

    additionalProperties: false

  "^gpio@[0-9]+$":
    type: object
    properties:
      compatible:
        enum:
          - fsl,imx23-gpio
          - fsl,imx28-gpio

      reg:
        maxItems: 1

      interrupts:
        description: Should be the port interrupt shared by all 32 pins.
        maxItems: 1

      interrupt-controller: true

      "#interrupt-cells":
        const: 2

      "#gpio-cells":
        const: 2

      gpio-controller: true

    required:
      - compatible
      - reg
      - interrupts
      - interrupt-controller
      - "#interrupt-cells"
      - "#gpio-cells"
      - gpio-controller

    additionalProperties: false

required:
  - compatible
  - reg
  - '#address-cells'
  - '#size-cells'

additionalProperties: false

examples:
  - |
    pinctrl@80018000 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fsl,imx28-pinctrl", "simple-bus";
        reg = <0x80018000 0x2000>;

        gpio@0 {
            compatible = "fsl,imx28-gpio";
            reg = <0>;
            interrupts = <127>;
            gpio-controller;
            #gpio-cells = <2>;
            interrupt-controller;
            #interrupt-cells = <2>;
        };

        gpio@1 {
            compatible = "fsl,imx28-gpio";
            reg = <1>;
            interrupts = <126>;
            gpio-controller;
            #gpio-cells = <2>;
            interrupt-controller;
            #interrupt-cells = <2>;
        };

        gpio@2 {
            compatible = "fsl,imx28-gpio";
            reg = <2>;
            interrupts = <125>;
            gpio-controller;
            #gpio-cells = <2>;
            interrupt-controller;
            #interrupt-cells = <2>;
        };

        gpio@3 {
            compatible = "fsl,imx28-gpio";
            reg = <3>;
            interrupts = <124>;
            gpio-controller;
            #gpio-cells = <2>;
            interrupt-controller;
            #interrupt-cells = <2>;
        };

        gpio@4 {
            compatible = "fsl,imx28-gpio";
            reg = <4>;
            interrupts = <123>;
            gpio-controller;
            #gpio-cells = <2>;
            interrupt-controller;
            #interrupt-cells = <2>;
        };

        lcdif-apx4@5 {
            reg = <5>;
            fsl,pinmux-ids = <0x1181 0x1191>;
            fsl,drive-strength = <0>;
            fsl,voltage = <0>;
            fsl,pull-up = <0>;
        };
    };