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