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