xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/qcom,pmic-gpio.yaml (revision c9ccf3a32da427475985b85d7df023ccfb138c27)
1354d7675SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2354d7675SEmmanuel Vadot%YAML 1.2
3354d7675SEmmanuel Vadot---
4354d7675SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/qcom,pmic-gpio.yaml#
5354d7675SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6354d7675SEmmanuel Vadot
7354d7675SEmmanuel Vadottitle: Qualcomm PMIC GPIO block
8354d7675SEmmanuel Vadot
9354d7675SEmmanuel Vadotmaintainers:
10354d7675SEmmanuel Vadot  - Bjorn Andersson <bjorn.andersson@linaro.org>
11354d7675SEmmanuel Vadot
12354d7675SEmmanuel Vadotdescription:
13354d7675SEmmanuel Vadot  This binding describes the GPIO block(s) found in the 8xxx series of
14354d7675SEmmanuel Vadot  PMIC's from Qualcomm.
15354d7675SEmmanuel Vadot
16354d7675SEmmanuel Vadotproperties:
17354d7675SEmmanuel Vadot  compatible:
18354d7675SEmmanuel Vadot    items:
19354d7675SEmmanuel Vadot      - enum:
20e67e8565SEmmanuel Vadot          - qcom,pm2250-gpio
21354d7675SEmmanuel Vadot          - qcom,pm660-gpio
22354d7675SEmmanuel Vadot          - qcom,pm660l-gpio
23354d7675SEmmanuel Vadot          - qcom,pm6150-gpio
24354d7675SEmmanuel Vadot          - qcom,pm6150l-gpio
258cc087a1SEmmanuel Vadot          - qcom,pm6350-gpio
26354d7675SEmmanuel Vadot          - qcom,pm7325-gpio
27354d7675SEmmanuel Vadot          - qcom,pm8005-gpio
28354d7675SEmmanuel Vadot          - qcom,pm8008-gpio
29354d7675SEmmanuel Vadot          - qcom,pm8018-gpio
30e67e8565SEmmanuel Vadot          - qcom,pm8019-gpio
31354d7675SEmmanuel Vadot          - qcom,pm8038-gpio
32354d7675SEmmanuel Vadot          - qcom,pm8058-gpio
33354d7675SEmmanuel Vadot          - qcom,pm8150-gpio
34354d7675SEmmanuel Vadot          - qcom,pm8150b-gpio
35e67e8565SEmmanuel Vadot          - qcom,pm8226-gpio
36354d7675SEmmanuel Vadot          - qcom,pm8350-gpio
37354d7675SEmmanuel Vadot          - qcom,pm8350b-gpio
38354d7675SEmmanuel Vadot          - qcom,pm8350c-gpio
39*c9ccf3a3SEmmanuel Vadot          - qcom,pm8450-gpio
40354d7675SEmmanuel Vadot          - qcom,pm8916-gpio
41354d7675SEmmanuel Vadot          - qcom,pm8917-gpio
42354d7675SEmmanuel Vadot          - qcom,pm8921-gpio
43354d7675SEmmanuel Vadot          - qcom,pm8941-gpio
44354d7675SEmmanuel Vadot          - qcom,pm8950-gpio
45354d7675SEmmanuel Vadot          - qcom,pm8994-gpio
46354d7675SEmmanuel Vadot          - qcom,pm8998-gpio
47354d7675SEmmanuel Vadot          - qcom,pma8084-gpio
48354d7675SEmmanuel Vadot          - qcom,pmi8950-gpio
49354d7675SEmmanuel Vadot          - qcom,pmi8994-gpio
50354d7675SEmmanuel Vadot          - qcom,pmi8998-gpio
51354d7675SEmmanuel Vadot          - qcom,pmk8350-gpio
52354d7675SEmmanuel Vadot          - qcom,pmr735a-gpio
53354d7675SEmmanuel Vadot          - qcom,pmr735b-gpio
54354d7675SEmmanuel Vadot          - qcom,pms405-gpio
55354d7675SEmmanuel Vadot          - qcom,pmx55-gpio
56354d7675SEmmanuel Vadot
57354d7675SEmmanuel Vadot      - enum:
58354d7675SEmmanuel Vadot          - qcom,spmi-gpio
59354d7675SEmmanuel Vadot          - qcom,ssbi-gpio
60354d7675SEmmanuel Vadot
61354d7675SEmmanuel Vadot  reg:
62354d7675SEmmanuel Vadot    maxItems: 1
63354d7675SEmmanuel Vadot
64354d7675SEmmanuel Vadot  interrupt-controller: true
65354d7675SEmmanuel Vadot
66354d7675SEmmanuel Vadot  '#interrupt-cells':
67354d7675SEmmanuel Vadot    const: 2
68354d7675SEmmanuel Vadot
69354d7675SEmmanuel Vadot  gpio-controller: true
70354d7675SEmmanuel Vadot
71354d7675SEmmanuel Vadot  gpio-ranges:
72354d7675SEmmanuel Vadot    maxItems: 1
73354d7675SEmmanuel Vadot
74354d7675SEmmanuel Vadot  '#gpio-cells':
75354d7675SEmmanuel Vadot    const: 2
76354d7675SEmmanuel Vadot    description:
77354d7675SEmmanuel Vadot      The first cell will be used to define gpio number and the
78354d7675SEmmanuel Vadot      second denotes the flags for this gpio
79354d7675SEmmanuel Vadot
80354d7675SEmmanuel VadotadditionalProperties: false
81354d7675SEmmanuel Vadot
82354d7675SEmmanuel Vadotrequired:
83354d7675SEmmanuel Vadot  - compatible
84354d7675SEmmanuel Vadot  - reg
85354d7675SEmmanuel Vadot  - gpio-controller
86354d7675SEmmanuel Vadot  - '#gpio-cells'
87354d7675SEmmanuel Vadot  - gpio-ranges
88354d7675SEmmanuel Vadot  - interrupt-controller
89354d7675SEmmanuel Vadot
90354d7675SEmmanuel VadotpatternProperties:
91354d7675SEmmanuel Vadot  '-state$':
92354d7675SEmmanuel Vadot    oneOf:
93354d7675SEmmanuel Vadot      - $ref: "#/$defs/qcom-pmic-gpio-state"
94354d7675SEmmanuel Vadot      - patternProperties:
95354d7675SEmmanuel Vadot          ".*":
96354d7675SEmmanuel Vadot            $ref: "#/$defs/qcom-pmic-gpio-state"
97354d7675SEmmanuel Vadot
98354d7675SEmmanuel Vadot$defs:
99354d7675SEmmanuel Vadot  qcom-pmic-gpio-state:
100354d7675SEmmanuel Vadot    type: object
101354d7675SEmmanuel Vadot    allOf:
102354d7675SEmmanuel Vadot      - $ref: "pinmux-node.yaml"
103354d7675SEmmanuel Vadot      - $ref: "pincfg-node.yaml"
104354d7675SEmmanuel Vadot    properties:
105354d7675SEmmanuel Vadot      pins:
106354d7675SEmmanuel Vadot        description:
107354d7675SEmmanuel Vadot          List of gpio pins affected by the properties specified in
108354d7675SEmmanuel Vadot          this subnode.  Valid pins are
109354d7675SEmmanuel Vadot                 - gpio1-gpio10 for pm6150
110354d7675SEmmanuel Vadot                 - gpio1-gpio12 for pm6150l
1118cc087a1SEmmanuel Vadot                 - gpio1-gpio9 for pm6350
112354d7675SEmmanuel Vadot                 - gpio1-gpio10 for pm7325
113354d7675SEmmanuel Vadot                 - gpio1-gpio4 for pm8005
114354d7675SEmmanuel Vadot                 - gpio1-gpio2 for pm8008
115354d7675SEmmanuel Vadot                 - gpio1-gpio6 for pm8018
116354d7675SEmmanuel Vadot                 - gpio1-gpio12 for pm8038
117354d7675SEmmanuel Vadot                 - gpio1-gpio40 for pm8058
118354d7675SEmmanuel Vadot                 - gpio1-gpio10 for pm8150 (holes on gpio2, gpio5,
119354d7675SEmmanuel Vadot                                            gpio7 and gpio8)
120354d7675SEmmanuel Vadot                 - gpio1-gpio12 for pm8150b (holes on gpio3, gpio4
121354d7675SEmmanuel Vadot                                             and gpio7)
122354d7675SEmmanuel Vadot                 - gpio1-gpio12 for pm8150l (hole on gpio7)
123354d7675SEmmanuel Vadot                 - gpio1-gpio4 for pm8916
124354d7675SEmmanuel Vadot                 - gpio1-gpio10 for pm8350
125354d7675SEmmanuel Vadot                 - gpio1-gpio8 for pm8350b
126354d7675SEmmanuel Vadot                 - gpio1-gpio9 for pm8350c
127354d7675SEmmanuel Vadot                 - gpio1-gpio38 for pm8917
128354d7675SEmmanuel Vadot                 - gpio1-gpio44 for pm8921
129354d7675SEmmanuel Vadot                 - gpio1-gpio36 for pm8941
130354d7675SEmmanuel Vadot                 - gpio1-gpio8 for pm8950 (hole on gpio3)
131354d7675SEmmanuel Vadot                 - gpio1-gpio22 for pm8994
132354d7675SEmmanuel Vadot                 - gpio1-gpio26 for pm8998
133354d7675SEmmanuel Vadot                 - gpio1-gpio22 for pma8084
134354d7675SEmmanuel Vadot                 - gpio1-gpio2 for pmi8950
135354d7675SEmmanuel Vadot                 - gpio1-gpio10 for pmi8994
136354d7675SEmmanuel Vadot                 - gpio1-gpio4 for pmk8350
137354d7675SEmmanuel Vadot                 - gpio1-gpio4 for pmr735a
138354d7675SEmmanuel Vadot                 - gpio1-gpio4 for pmr735b
139354d7675SEmmanuel Vadot                 - gpio1-gpio12 for pms405 (holes on gpio1, gpio9
140354d7675SEmmanuel Vadot                                            and gpio10)
141354d7675SEmmanuel Vadot                 - gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10
142354d7675SEmmanuel Vadot                                            and gpio11)
143354d7675SEmmanuel Vadot
144354d7675SEmmanuel Vadot        items:
145354d7675SEmmanuel Vadot          pattern: "^gpio([0-9]+)$"
146354d7675SEmmanuel Vadot
147354d7675SEmmanuel Vadot      function:
148354d7675SEmmanuel Vadot        items:
149354d7675SEmmanuel Vadot          - enum:
150354d7675SEmmanuel Vadot              - normal
151354d7675SEmmanuel Vadot              - paired
152354d7675SEmmanuel Vadot              - func1
153354d7675SEmmanuel Vadot              - func2
154354d7675SEmmanuel Vadot              - dtest1
155354d7675SEmmanuel Vadot              - dtest2
156354d7675SEmmanuel Vadot              - dtest3
157354d7675SEmmanuel Vadot              - dtest4
158354d7675SEmmanuel Vadot              - func3  # supported by LV/MV GPIO subtypes
159354d7675SEmmanuel Vadot              - func4  # supported by LV/MV GPIO subtypes
160354d7675SEmmanuel Vadot
161354d7675SEmmanuel Vadot      bias-disable: true
162354d7675SEmmanuel Vadot      bias-pull-down: true
163354d7675SEmmanuel Vadot      bias-pull-up: true
164354d7675SEmmanuel Vadot
165354d7675SEmmanuel Vadot      qcom,pull-up-strength:
166354d7675SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
167354d7675SEmmanuel Vadot        description:
168354d7675SEmmanuel Vadot          Specifies the strength to use for pull up, if selected.
169354d7675SEmmanuel Vadot          Valid values are defined in
170354d7675SEmmanuel Vadot          <dt-bindings/pinctrl/qcom,pmic-gpio.h>
171354d7675SEmmanuel Vadot          If this property is omitted 30uA strength will be used
172354d7675SEmmanuel Vadot          if pull up is selected
173354d7675SEmmanuel Vadot        enum: [0, 1, 2, 3]
174354d7675SEmmanuel Vadot
175354d7675SEmmanuel Vadot      bias-high-impedance: true
176354d7675SEmmanuel Vadot      input-enable: true
177354d7675SEmmanuel Vadot      output-high: true
178354d7675SEmmanuel Vadot      output-low: true
1798cc087a1SEmmanuel Vadot      output-enable: true
1808cc087a1SEmmanuel Vadot      output-disable: true
181354d7675SEmmanuel Vadot      power-source: true
182354d7675SEmmanuel Vadot
183354d7675SEmmanuel Vadot      qcom,drive-strength:
184354d7675SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
185354d7675SEmmanuel Vadot        description:
186354d7675SEmmanuel Vadot          Selects the drive strength for the specified pins
187354d7675SEmmanuel Vadot          Valid drive strength values are defined in
188354d7675SEmmanuel Vadot          <dt-bindings/pinctrl/qcom,pmic-gpio.h>
189354d7675SEmmanuel Vadot        enum: [0, 1, 2, 3]
190354d7675SEmmanuel Vadot
191354d7675SEmmanuel Vadot      drive-push-pull: true
192354d7675SEmmanuel Vadot      drive-open-drain: true
193354d7675SEmmanuel Vadot      drive-open-source: true
194354d7675SEmmanuel Vadot
195354d7675SEmmanuel Vadot      qcom,analog-pass:
196354d7675SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
197354d7675SEmmanuel Vadot        description:
198354d7675SEmmanuel Vadot          The specified pins are configured in
199354d7675SEmmanuel Vadot          analog-pass-through mode.
200354d7675SEmmanuel Vadot
201354d7675SEmmanuel Vadot      qcom,atest:
202354d7675SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
203354d7675SEmmanuel Vadot        description:
204354d7675SEmmanuel Vadot          Selects ATEST rail to route to GPIO when it's
205354d7675SEmmanuel Vadot          configured in analog-pass-through mode.
206354d7675SEmmanuel Vadot        enum: [1, 2, 3, 4]
207354d7675SEmmanuel Vadot
208354d7675SEmmanuel Vadot      qcom,dtest-buffer:
209354d7675SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
210354d7675SEmmanuel Vadot        description:
211354d7675SEmmanuel Vadot          Selects DTEST rail to route to GPIO when it's
212354d7675SEmmanuel Vadot          configured as digital input.
213354d7675SEmmanuel Vadot        enum: [1, 2, 3, 4]
214354d7675SEmmanuel Vadot
215354d7675SEmmanuel Vadot    required:
216354d7675SEmmanuel Vadot      - pins
217354d7675SEmmanuel Vadot      - function
218354d7675SEmmanuel Vadot
219354d7675SEmmanuel Vadot    additionalProperties: false
220354d7675SEmmanuel Vadot
221354d7675SEmmanuel Vadotexamples:
222354d7675SEmmanuel Vadot  - |
223354d7675SEmmanuel Vadot    #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
224354d7675SEmmanuel Vadot
225354d7675SEmmanuel Vadot    pm8921_gpio: gpio@150 {
226354d7675SEmmanuel Vadot      compatible = "qcom,pm8921-gpio", "qcom,ssbi-gpio";
227354d7675SEmmanuel Vadot      reg = <0x150 0x160>;
228354d7675SEmmanuel Vadot      interrupt-controller;
229354d7675SEmmanuel Vadot      #interrupt-cells = <2>;
230354d7675SEmmanuel Vadot      gpio-controller;
231354d7675SEmmanuel Vadot      gpio-ranges = <&pm8921_gpio 0 0 44>;
232354d7675SEmmanuel Vadot      #gpio-cells = <2>;
233354d7675SEmmanuel Vadot
234354d7675SEmmanuel Vadot      pm8921_gpio_keys: gpio-keys-state {
235354d7675SEmmanuel Vadot        volume-keys {
236354d7675SEmmanuel Vadot          pins = "gpio20", "gpio21";
237354d7675SEmmanuel Vadot          function = "normal";
238354d7675SEmmanuel Vadot
239354d7675SEmmanuel Vadot          input-enable;
240354d7675SEmmanuel Vadot          bias-pull-up;
241354d7675SEmmanuel Vadot          drive-push-pull;
242354d7675SEmmanuel Vadot          qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
243354d7675SEmmanuel Vadot          power-source = <PM8921_GPIO_S4>;
244354d7675SEmmanuel Vadot        };
245354d7675SEmmanuel Vadot      };
246354d7675SEmmanuel Vadot    };
247354d7675SEmmanuel Vadot...
248