summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml
blob: 80f960671857042ca4018b6a495822dbb3056c6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,pmic-mpp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm PMIC Multi-Purpose Pin (MPP) block

maintainers:
  - Bjorn Andersson <bjorn.andersson@linaro.org>

description:
  This binding describes the MPP block(s) found in the 8xxx series of
  PMIC's from Qualcomm.

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - qcom,pm8019-mpp
              - qcom,pm8226-mpp
              - qcom,pm8841-mpp
              - qcom,pm8916-mpp
              - qcom,pm8941-mpp
              - qcom,pm8950-mpp
              - qcom,pmi8950-mpp
              - qcom,pm8994-mpp
              - qcom,pma8084-mpp
              - qcom,pmi8994-mpp
          - const: qcom,spmi-mpp
      - items:
          - enum:
              - qcom,pm8018-mpp
              - qcom,pm8038-mpp
              - qcom,pm8058-mpp
              - qcom,pm8821-mpp
              - qcom,pm8917-mpp
              - qcom,pm8921-mpp
          - const: qcom,ssbi-mpp

  reg:
    maxItems: 1

  interrupt-controller: true

  '#interrupt-cells':
    const: 2

  gpio-controller: true
  gpio-line-names: true

  gpio-ranges:
    maxItems: 1

  '#gpio-cells':
    const: 2
    description:
      The first cell will be used to define gpio number and the
      second denotes the flags for this gpio

additionalProperties: false

required:
  - compatible
  - reg
  - gpio-controller
  - '#gpio-cells'
  - gpio-ranges
  - interrupt-controller

patternProperties:
  '-state$':
    oneOf:
      - $ref: "#/$defs/qcom-pmic-mpp-state"
      - patternProperties:
          '-pins$':
            $ref: "#/$defs/qcom-pmic-mpp-state"
        additionalProperties: false

$defs:
  qcom-pmic-mpp-state:
    type: object
    allOf:
      - $ref: pinmux-node.yaml
      - $ref: pincfg-node.yaml
    properties:
      pins:
        description:
          List of gpio pins affected by the properties specified in
          this subnode.  Valid pins are
                 - mpp1-mpp4 for pm8841
                 - mpp1-mpp4 for pm8916
                 - mpp1-mpp8 for pm8941
                 - mpp1-mpp4 for pm8950
                 - mpp1-mpp4 for pmi8950
                 - mpp1-mpp4 for pma8084

        items:
          pattern: "^mpp([0-9]+)$"

      function:
        items:
          - enum:
              - digital
              - analog
              - sink

      bias-disable: true
      bias-pull-up: true
      bias-high-impedance: true
      input-enable: true
      output-high: true
      output-low: true
      power-source: true

      qcom,analog-level:
        $ref: /schemas/types.yaml#/definitions/uint32
        description:
          Selects the source for analog output. Valued values are defined in
          <dt-binding/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AOUT_LVL_*
        enum: [0, 1, 2, 3, 4, 5, 6, 7]

      qcom,atest:
        $ref: /schemas/types.yaml#/definitions/uint32
        description:
          Selects ATEST rail to route to GPIO when it's
          configured in analog-pass-through mode.
        enum: [1, 2, 3, 4]

      qcom,dtest:
        $ref: /schemas/types.yaml#/definitions/uint32
        description:
          Selects DTEST rail to route to GPIO when it's
          configured as digital input.
        enum: [1, 2, 3, 4]

      qcom,amux-route:
        $ref: /schemas/types.yaml#/definitions/uint32
        description:
          Selects the source for analog input. Valid values are defined in
          <dt-bindings/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AMUX_ROUTE_CH5,
          PMIC_MPP_AMUX_ROUTE_CH6...
        enum: [0, 1, 2, 3, 4, 5, 6, 7]

      qcom,paired:
        type: boolean
        description:
          Indicates that the pin should be operating in paired mode.

    required:
      - pins
      - function

    additionalProperties: false

examples:
  - |
    #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>

    pm8841_mpp: mpps@a000 {
      compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
      reg = <0xa000 0>;
      gpio-controller;
      #gpio-cells = <2>;
      gpio-ranges = <&pm8841_mpp 0 0 4>;
      gpio-line-names = "VDD_PX_BIAS", "WLAN_LED_CTRL",
              "BT_LED_CTRL", "GPIO-F";
      interrupt-controller;
      #interrupt-cells = <2>;

      pinctrl-names = "default";
      pinctrl-0 = <&pm8841_default>;

      mpp1-state {
        pins = "mpp1";
        function = "digital";
        input-enable;
        power-source = <PM8841_MPP_S3>;
      };

      default-state {
        gpio-pins {
          pins = "mpp1", "mpp2", "mpp3", "mpp4";
          function = "digital";
          input-enable;
          power-source = <PM8841_MPP_S3>;
        };
      };
    };
...