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