1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/qcom,pmic-gpio.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm PMIC GPIO block
8
9maintainers:
10  - Bjorn Andersson <bjorn.andersson@linaro.org>
11
12description:
13  This binding describes the GPIO block(s) found in the 8xxx series of
14  PMIC's from Qualcomm.
15
16properties:
17  compatible:
18    items:
19      - enum:
20          - qcom,pm2250-gpio
21          - qcom,pm660-gpio
22          - qcom,pm660l-gpio
23          - qcom,pm6125-gpio
24          - qcom,pm6150-gpio
25          - qcom,pm6150l-gpio
26          - qcom,pm6350-gpio
27          - qcom,pm7325-gpio
28          - qcom,pm8005-gpio
29          - qcom,pm8008-gpio
30          - qcom,pm8018-gpio
31          - qcom,pm8019-gpio
32          - qcom,pm8038-gpio
33          - qcom,pm8058-gpio
34          - qcom,pm8150-gpio
35          - qcom,pm8150b-gpio
36          - qcom,pm8226-gpio
37          - qcom,pm8350-gpio
38          - qcom,pm8350b-gpio
39          - qcom,pm8350c-gpio
40          - qcom,pm8450-gpio
41          - qcom,pm8916-gpio
42          - qcom,pm8917-gpio
43          - qcom,pm8921-gpio
44          - qcom,pm8941-gpio
45          - qcom,pm8950-gpio
46          - qcom,pm8994-gpio
47          - qcom,pm8998-gpio
48          - qcom,pma8084-gpio
49          - qcom,pmi8950-gpio
50          - qcom,pmi8994-gpio
51          - qcom,pmi8998-gpio
52          - qcom,pmk8350-gpio
53          - qcom,pmr735a-gpio
54          - qcom,pmr735b-gpio
55          - qcom,pms405-gpio
56          - qcom,pmx55-gpio
57          - qcom,pmx65-gpio
58
59      - enum:
60          - qcom,spmi-gpio
61          - qcom,ssbi-gpio
62
63  reg:
64    maxItems: 1
65
66  interrupt-controller: true
67
68  '#interrupt-cells':
69    const: 2
70
71  gpio-controller: true
72
73  gpio-ranges:
74    maxItems: 1
75
76  '#gpio-cells':
77    const: 2
78    description:
79      The first cell will be used to define gpio number and the
80      second denotes the flags for this gpio
81
82additionalProperties: false
83
84required:
85  - compatible
86  - reg
87  - gpio-controller
88  - '#gpio-cells'
89  - gpio-ranges
90  - interrupt-controller
91
92patternProperties:
93  '-state$':
94    oneOf:
95      - $ref: "#/$defs/qcom-pmic-gpio-state"
96      - patternProperties:
97          ".*":
98            $ref: "#/$defs/qcom-pmic-gpio-state"
99
100$defs:
101  qcom-pmic-gpio-state:
102    type: object
103    allOf:
104      - $ref: "pinmux-node.yaml"
105      - $ref: "pincfg-node.yaml"
106    properties:
107      pins:
108        description:
109          List of gpio pins affected by the properties specified in
110          this subnode.  Valid pins are
111                 - gpio1-gpio9 for pm6125
112                 - gpio1-gpio10 for pm6150
113                 - gpio1-gpio12 for pm6150l
114                 - gpio1-gpio9 for pm6350
115                 - gpio1-gpio10 for pm7325
116                 - gpio1-gpio4 for pm8005
117                 - gpio1-gpio2 for pm8008
118                 - gpio1-gpio6 for pm8018
119                 - gpio1-gpio12 for pm8038
120                 - gpio1-gpio40 for pm8058
121                 - gpio1-gpio10 for pm8150 (holes on gpio2, gpio5,
122                                            gpio7 and gpio8)
123                 - gpio1-gpio12 for pm8150b (holes on gpio3, gpio4
124                                             and gpio7)
125                 - gpio1-gpio12 for pm8150l (hole on gpio7)
126                 - gpio1-gpio4 for pm8916
127                 - gpio1-gpio10 for pm8350
128                 - gpio1-gpio8 for pm8350b
129                 - gpio1-gpio9 for pm8350c
130                 - gpio1-gpio38 for pm8917
131                 - gpio1-gpio44 for pm8921
132                 - gpio1-gpio36 for pm8941
133                 - gpio1-gpio8 for pm8950 (hole on gpio3)
134                 - gpio1-gpio22 for pm8994
135                 - gpio1-gpio26 for pm8998
136                 - gpio1-gpio22 for pma8084
137                 - gpio1-gpio2 for pmi8950
138                 - gpio1-gpio10 for pmi8994
139                 - gpio1-gpio4 for pmk8350
140                 - gpio1-gpio4 for pmr735a
141                 - gpio1-gpio4 for pmr735b
142                 - gpio1-gpio12 for pms405 (holes on gpio1, gpio9
143                                            and gpio10)
144                 - gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10
145                                            and gpio11)
146                 - gpio1-gpio16 for pmx65
147
148        items:
149          pattern: "^gpio([0-9]+)$"
150
151      function:
152        items:
153          - enum:
154              - normal
155              - paired
156              - func1
157              - func2
158              - dtest1
159              - dtest2
160              - dtest3
161              - dtest4
162              - func3  # supported by LV/MV GPIO subtypes
163              - func4  # supported by LV/MV GPIO subtypes
164
165      bias-disable: true
166      bias-pull-down: true
167      bias-pull-up: true
168
169      qcom,pull-up-strength:
170        $ref: /schemas/types.yaml#/definitions/uint32
171        description:
172          Specifies the strength to use for pull up, if selected.
173          Valid values are defined in
174          <dt-bindings/pinctrl/qcom,pmic-gpio.h>
175          If this property is omitted 30uA strength will be used
176          if pull up is selected
177        enum: [0, 1, 2, 3]
178
179      bias-high-impedance: true
180      input-enable: true
181      output-high: true
182      output-low: true
183      output-enable: true
184      output-disable: true
185      power-source: true
186
187      qcom,drive-strength:
188        $ref: /schemas/types.yaml#/definitions/uint32
189        description:
190          Selects the drive strength for the specified pins
191          Valid drive strength values are defined in
192          <dt-bindings/pinctrl/qcom,pmic-gpio.h>
193        enum: [0, 1, 2, 3]
194
195      drive-push-pull: true
196      drive-open-drain: true
197      drive-open-source: true
198
199      qcom,analog-pass:
200        $ref: /schemas/types.yaml#/definitions/flag
201        description:
202          The specified pins are configured in
203          analog-pass-through mode.
204
205      qcom,atest:
206        $ref: /schemas/types.yaml#/definitions/uint32
207        description:
208          Selects ATEST rail to route to GPIO when it's
209          configured in analog-pass-through mode.
210        enum: [1, 2, 3, 4]
211
212      qcom,dtest-buffer:
213        $ref: /schemas/types.yaml#/definitions/uint32
214        description:
215          Selects DTEST rail to route to GPIO when it's
216          configured as digital input.
217        enum: [1, 2, 3, 4]
218
219    required:
220      - pins
221      - function
222
223    additionalProperties: false
224
225examples:
226  - |
227    #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
228
229    pm8921_gpio: gpio@150 {
230      compatible = "qcom,pm8921-gpio", "qcom,ssbi-gpio";
231      reg = <0x150 0x160>;
232      interrupt-controller;
233      #interrupt-cells = <2>;
234      gpio-controller;
235      gpio-ranges = <&pm8921_gpio 0 0 44>;
236      #gpio-cells = <2>;
237
238      pm8921_gpio_keys: gpio-keys-state {
239        volume-keys {
240          pins = "gpio20", "gpio21";
241          function = "normal";
242
243          input-enable;
244          bias-pull-up;
245          drive-push-pull;
246          qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
247          power-source = <PM8921_GPIO_S4>;
248        };
249      };
250    };
251...
252