Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 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 | |
| 7 | title: Qualcomm PMIC Multi-Purpose Pin (MPP) block |
| 8 | |
| 9 | maintainers: |
| 10 | - Bjorn Andersson <bjorn.andersson@linaro.org> |
| 11 | |
| 12 | description: |
| 13 | This binding describes the MPP block(s) found in the 8xxx series of |
| 14 | PMIC's from Qualcomm. |
| 15 | |
| 16 | properties: |
| 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 | |
| 62 | additionalProperties: false |
| 63 | |
| 64 | required: |
| 65 | - compatible |
| 66 | - reg |
| 67 | - gpio-controller |
| 68 | - '#gpio-cells' |
| 69 | - gpio-ranges |
| 70 | - interrupt-controller |
| 71 | |
| 72 | patternProperties: |
| 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 | |
| 157 | examples: |
| 158 | - | |
| 159 | #include <dt-bindings/pinctrl/qcom,pmic-mpp.h> |
| 160 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 161 | pmic { |
| 162 | #address-cells = <1>; |
| 163 | #size-cells = <0>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 164 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 165 | pm8841_mpp: mpps@a000 { |
| 166 | compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp"; |
| 167 | reg = <0xa000>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 168 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 169 | gpio-controller; |
| 170 | #gpio-cells = <2>; |
| 171 | gpio-ranges = <&pm8841_mpp 0 0 4>; |
| 172 | gpio-line-names = "VDD_PX_BIAS", "WLAN_LED_CTRL", |
| 173 | "BT_LED_CTRL", "GPIO-F"; |
| 174 | interrupt-controller; |
| 175 | #interrupt-cells = <2>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 176 | |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 177 | pinctrl-names = "default"; |
| 178 | pinctrl-0 = <&pm8841_default>; |
| 179 | |
| 180 | mpp1-state { |
| 181 | pins = "mpp1"; |
| 182 | function = "digital"; |
| 183 | input-enable; |
| 184 | power-source = <PM8841_MPP_S3>; |
| 185 | }; |
| 186 | |
| 187 | default-state { |
| 188 | gpio-pins { |
| 189 | pins = "mpp1", "mpp2", "mpp3", "mpp4"; |
| 190 | function = "digital"; |
| 191 | input-enable; |
| 192 | power-source = <PM8841_MPP_S3>; |
| 193 | }; |
| 194 | }; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 195 | }; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 196 | }; |
| 197 | ... |