xref: /linux/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
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-mpp.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm PMIC Multi-Purpose Pin (MPP) block
8
9maintainers:
10  - Bjorn Andersson <bjorn.andersson@linaro.org>
11
12description:
13  This binding describes the MPP block(s) found in the 8xxx series of
14  PMIC's from Qualcomm.
15
16properties:
17  compatible:
18    oneOf:
19      - items:
20          - enum:
21              - qcom,pm8019-mpp
22              - qcom,pm8226-mpp
23              - qcom,pm8841-mpp
24              - qcom,pm8916-mpp
25              - qcom,pm8937-mpp
26              - qcom,pm8941-mpp
27              - qcom,pm8950-mpp
28              - qcom,pmi8950-mpp
29              - qcom,pm8994-mpp
30              - qcom,pma8084-mpp
31              - qcom,pmi8994-mpp
32          - const: qcom,spmi-mpp
33      - items:
34          - enum:
35              - qcom,pm8018-mpp
36              - qcom,pm8038-mpp
37              - qcom,pm8058-mpp
38              - qcom,pm8821-mpp
39              - qcom,pm8901-mpp
40              - qcom,pm8917-mpp
41              - qcom,pm8921-mpp
42          - const: qcom,ssbi-mpp
43
44  reg:
45    maxItems: 1
46
47  interrupt-controller: true
48
49  '#interrupt-cells':
50    const: 2
51
52  gpio-controller: true
53  gpio-line-names: true
54
55  gpio-ranges:
56    maxItems: 1
57
58  '#gpio-cells':
59    const: 2
60    description:
61      The first cell will be used to define gpio number and the
62      second denotes the flags for this gpio
63
64additionalProperties: false
65
66required:
67  - compatible
68  - reg
69  - gpio-controller
70  - '#gpio-cells'
71  - gpio-ranges
72  - interrupt-controller
73
74patternProperties:
75  '-state$':
76    oneOf:
77      - $ref: "#/$defs/qcom-pmic-mpp-state"
78      - patternProperties:
79          '-pins$':
80            $ref: "#/$defs/qcom-pmic-mpp-state"
81        additionalProperties: false
82
83$defs:
84  qcom-pmic-mpp-state:
85    type: object
86    allOf:
87      - $ref: pinmux-node.yaml
88      - $ref: pincfg-node.yaml
89    properties:
90      pins:
91        description:
92          List of gpio pins affected by the properties specified in
93          this subnode.  Valid pins are
94                 - mpp1-mpp4 for pm8841
95                 - mpp1-mpp4 for pm8916
96                 - mpp1-mpp4 for pm8937
97                 - mpp1-mpp8 for pm8941
98                 - mpp1-mpp4 for pm8950
99                 - mpp1-mpp4 for pmi8950
100                 - mpp1-mpp4 for pma8084
101
102        items:
103          pattern: "^mpp([0-9]+)$"
104
105      function:
106        items:
107          - enum:
108              - digital
109              - analog
110              - sink
111
112      bias-disable: true
113      bias-pull-up: true
114      bias-high-impedance: true
115      input-enable: true
116      output-high: true
117      output-low: true
118      power-source: true
119
120      qcom,analog-level:
121        $ref: /schemas/types.yaml#/definitions/uint32
122        description:
123          Selects the source for analog output. Valued values are defined in
124          <dt-binding/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AOUT_LVL_*
125        enum: [0, 1, 2, 3, 4, 5, 6, 7]
126
127      qcom,atest:
128        $ref: /schemas/types.yaml#/definitions/uint32
129        description:
130          Selects ATEST rail to route to GPIO when it's
131          configured in analog-pass-through mode.
132        enum: [1, 2, 3, 4]
133
134      qcom,dtest:
135        $ref: /schemas/types.yaml#/definitions/uint32
136        description:
137          Selects DTEST rail to route to GPIO when it's
138          configured as digital input.
139        enum: [1, 2, 3, 4]
140
141      qcom,amux-route:
142        $ref: /schemas/types.yaml#/definitions/uint32
143        description:
144          Selects the source for analog input. Valid values are defined in
145          <dt-bindings/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AMUX_ROUTE_CH5,
146          PMIC_MPP_AMUX_ROUTE_CH6...
147        enum: [0, 1, 2, 3, 4, 5, 6, 7]
148
149      qcom,paired:
150        type: boolean
151        description:
152          Indicates that the pin should be operating in paired mode.
153
154    required:
155      - pins
156      - function
157
158    additionalProperties: false
159
160examples:
161  - |
162    #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
163
164    pmic {
165        #address-cells = <1>;
166        #size-cells = <0>;
167
168        pm8841_mpp: mpps@a000 {
169            compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
170            reg = <0xa000>;
171
172            gpio-controller;
173            #gpio-cells = <2>;
174            gpio-ranges = <&pm8841_mpp 0 0 4>;
175            gpio-line-names = "VDD_PX_BIAS", "WLAN_LED_CTRL",
176                              "BT_LED_CTRL", "GPIO-F";
177            interrupt-controller;
178            #interrupt-cells = <2>;
179
180            pinctrl-names = "default";
181            pinctrl-0 = <&pm8841_default>;
182
183            mpp1-state {
184                pins = "mpp1";
185                function = "digital";
186                input-enable;
187                power-source = <PM8841_MPP_S3>;
188            };
189
190            default-state {
191                gpio-pins {
192                    pins = "mpp1", "mpp2", "mpp3", "mpp4";
193                    function = "digital";
194                    input-enable;
195                    power-source = <PM8841_MPP_S3>;
196                };
197            };
198        };
199    };
200...
201