xref: /freebsd-src/sys/contrib/device-tree/Bindings/pinctrl/qcom,pmic-mpp.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
28cc087a1SEmmanuel Vadot%YAML 1.2
38cc087a1SEmmanuel Vadot---
48cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/qcom,pmic-mpp.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78cc087a1SEmmanuel Vadottitle: Qualcomm PMIC Multi-Purpose Pin (MPP) block
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - Bjorn Andersson <bjorn.andersson@linaro.org>
118cc087a1SEmmanuel Vadot
128cc087a1SEmmanuel Vadotdescription:
138cc087a1SEmmanuel Vadot  This binding describes the MPP block(s) found in the 8xxx series of
148cc087a1SEmmanuel Vadot  PMIC's from Qualcomm.
158cc087a1SEmmanuel Vadot
168cc087a1SEmmanuel Vadotproperties:
178cc087a1SEmmanuel Vadot  compatible:
188bab661aSEmmanuel Vadot    oneOf:
198bab661aSEmmanuel Vadot      - items:
208cc087a1SEmmanuel Vadot          - enum:
218cc087a1SEmmanuel Vadot              - qcom,pm8019-mpp
22c9ccf3a3SEmmanuel Vadot              - qcom,pm8226-mpp
238cc087a1SEmmanuel Vadot              - qcom,pm8841-mpp
248cc087a1SEmmanuel Vadot              - qcom,pm8916-mpp
258cc087a1SEmmanuel Vadot              - qcom,pm8941-mpp
268cc087a1SEmmanuel Vadot              - qcom,pm8950-mpp
278cc087a1SEmmanuel Vadot              - qcom,pmi8950-mpp
288cc087a1SEmmanuel Vadot              - qcom,pm8994-mpp
298cc087a1SEmmanuel Vadot              - qcom,pma8084-mpp
308cc087a1SEmmanuel Vadot              - qcom,pmi8994-mpp
318bab661aSEmmanuel Vadot          - const: qcom,spmi-mpp
328bab661aSEmmanuel Vadot      - items:
338cc087a1SEmmanuel Vadot          - enum:
348bab661aSEmmanuel Vadot              - qcom,pm8018-mpp
358bab661aSEmmanuel Vadot              - qcom,pm8038-mpp
368bab661aSEmmanuel Vadot              - qcom,pm8058-mpp
378bab661aSEmmanuel Vadot              - qcom,pm8821-mpp
38*7d0873ebSEmmanuel Vadot              - qcom,pm8901-mpp
398bab661aSEmmanuel Vadot              - qcom,pm8917-mpp
408bab661aSEmmanuel Vadot              - qcom,pm8921-mpp
418bab661aSEmmanuel Vadot          - const: qcom,ssbi-mpp
428cc087a1SEmmanuel Vadot
438cc087a1SEmmanuel Vadot  reg:
448cc087a1SEmmanuel Vadot    maxItems: 1
458cc087a1SEmmanuel Vadot
468cc087a1SEmmanuel Vadot  interrupt-controller: true
478cc087a1SEmmanuel Vadot
488cc087a1SEmmanuel Vadot  '#interrupt-cells':
498cc087a1SEmmanuel Vadot    const: 2
508cc087a1SEmmanuel Vadot
518cc087a1SEmmanuel Vadot  gpio-controller: true
528cc087a1SEmmanuel Vadot  gpio-line-names: true
538cc087a1SEmmanuel Vadot
548cc087a1SEmmanuel Vadot  gpio-ranges:
558cc087a1SEmmanuel Vadot    maxItems: 1
568cc087a1SEmmanuel Vadot
578cc087a1SEmmanuel Vadot  '#gpio-cells':
588cc087a1SEmmanuel Vadot    const: 2
598cc087a1SEmmanuel Vadot    description:
608cc087a1SEmmanuel Vadot      The first cell will be used to define gpio number and the
618cc087a1SEmmanuel Vadot      second denotes the flags for this gpio
628cc087a1SEmmanuel Vadot
638cc087a1SEmmanuel VadotadditionalProperties: false
648cc087a1SEmmanuel Vadot
658cc087a1SEmmanuel Vadotrequired:
668cc087a1SEmmanuel Vadot  - compatible
678cc087a1SEmmanuel Vadot  - reg
688cc087a1SEmmanuel Vadot  - gpio-controller
698cc087a1SEmmanuel Vadot  - '#gpio-cells'
708cc087a1SEmmanuel Vadot  - gpio-ranges
718cc087a1SEmmanuel Vadot  - interrupt-controller
728cc087a1SEmmanuel Vadot
738cc087a1SEmmanuel VadotpatternProperties:
748cc087a1SEmmanuel Vadot  '-state$':
758cc087a1SEmmanuel Vadot    oneOf:
768cc087a1SEmmanuel Vadot      - $ref: "#/$defs/qcom-pmic-mpp-state"
778cc087a1SEmmanuel Vadot      - patternProperties:
78cb7aa33aSEmmanuel Vadot          '-pins$':
798cc087a1SEmmanuel Vadot            $ref: "#/$defs/qcom-pmic-mpp-state"
808cc087a1SEmmanuel Vadot        additionalProperties: false
818cc087a1SEmmanuel Vadot
828cc087a1SEmmanuel Vadot$defs:
838cc087a1SEmmanuel Vadot  qcom-pmic-mpp-state:
848cc087a1SEmmanuel Vadot    type: object
858cc087a1SEmmanuel Vadot    allOf:
86fac71e4eSEmmanuel Vadot      - $ref: pinmux-node.yaml
87fac71e4eSEmmanuel Vadot      - $ref: pincfg-node.yaml
888cc087a1SEmmanuel Vadot    properties:
898cc087a1SEmmanuel Vadot      pins:
908cc087a1SEmmanuel Vadot        description:
918cc087a1SEmmanuel Vadot          List of gpio pins affected by the properties specified in
928cc087a1SEmmanuel Vadot          this subnode.  Valid pins are
938cc087a1SEmmanuel Vadot                 - mpp1-mpp4 for pm8841
948cc087a1SEmmanuel Vadot                 - mpp1-mpp4 for pm8916
958cc087a1SEmmanuel Vadot                 - mpp1-mpp8 for pm8941
968cc087a1SEmmanuel Vadot                 - mpp1-mpp4 for pm8950
978cc087a1SEmmanuel Vadot                 - mpp1-mpp4 for pmi8950
988cc087a1SEmmanuel Vadot                 - mpp1-mpp4 for pma8084
998cc087a1SEmmanuel Vadot
1008cc087a1SEmmanuel Vadot        items:
1018cc087a1SEmmanuel Vadot          pattern: "^mpp([0-9]+)$"
1028cc087a1SEmmanuel Vadot
1038cc087a1SEmmanuel Vadot      function:
1048cc087a1SEmmanuel Vadot        items:
1058cc087a1SEmmanuel Vadot          - enum:
1068cc087a1SEmmanuel Vadot              - digital
1078cc087a1SEmmanuel Vadot              - analog
1088cc087a1SEmmanuel Vadot              - sink
1098cc087a1SEmmanuel Vadot
1108cc087a1SEmmanuel Vadot      bias-disable: true
1118cc087a1SEmmanuel Vadot      bias-pull-up: true
1128cc087a1SEmmanuel Vadot      bias-high-impedance: true
1138cc087a1SEmmanuel Vadot      input-enable: true
1148cc087a1SEmmanuel Vadot      output-high: true
1158cc087a1SEmmanuel Vadot      output-low: true
1168cc087a1SEmmanuel Vadot      power-source: true
1178cc087a1SEmmanuel Vadot
1188cc087a1SEmmanuel Vadot      qcom,analog-level:
1198cc087a1SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
1208cc087a1SEmmanuel Vadot        description:
1218cc087a1SEmmanuel Vadot          Selects the source for analog output. Valued values are defined in
1228cc087a1SEmmanuel Vadot          <dt-binding/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AOUT_LVL_*
1238cc087a1SEmmanuel Vadot        enum: [0, 1, 2, 3, 4, 5, 6, 7]
1248cc087a1SEmmanuel Vadot
1258cc087a1SEmmanuel Vadot      qcom,atest:
1268cc087a1SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
1278cc087a1SEmmanuel Vadot        description:
1288cc087a1SEmmanuel Vadot          Selects ATEST rail to route to GPIO when it's
1298cc087a1SEmmanuel Vadot          configured in analog-pass-through mode.
1308cc087a1SEmmanuel Vadot        enum: [1, 2, 3, 4]
1318cc087a1SEmmanuel Vadot
1328cc087a1SEmmanuel Vadot      qcom,dtest:
1338cc087a1SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
1348cc087a1SEmmanuel Vadot        description:
1358cc087a1SEmmanuel Vadot          Selects DTEST rail to route to GPIO when it's
1368cc087a1SEmmanuel Vadot          configured as digital input.
1378cc087a1SEmmanuel Vadot        enum: [1, 2, 3, 4]
1388cc087a1SEmmanuel Vadot
1398cc087a1SEmmanuel Vadot      qcom,amux-route:
1408cc087a1SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
1418cc087a1SEmmanuel Vadot        description:
1428cc087a1SEmmanuel Vadot          Selects the source for analog input. Valid values are defined in
1438cc087a1SEmmanuel Vadot          <dt-bindings/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AMUX_ROUTE_CH5,
1448cc087a1SEmmanuel Vadot          PMIC_MPP_AMUX_ROUTE_CH6...
1458cc087a1SEmmanuel Vadot        enum: [0, 1, 2, 3, 4, 5, 6, 7]
1468cc087a1SEmmanuel Vadot
1478cc087a1SEmmanuel Vadot      qcom,paired:
148fac71e4eSEmmanuel Vadot        type: boolean
149fac71e4eSEmmanuel Vadot        description:
1508cc087a1SEmmanuel Vadot          Indicates that the pin should be operating in paired mode.
1518cc087a1SEmmanuel Vadot
1528cc087a1SEmmanuel Vadot    required:
1538cc087a1SEmmanuel Vadot      - pins
1548cc087a1SEmmanuel Vadot      - function
1558cc087a1SEmmanuel Vadot
1568cc087a1SEmmanuel Vadot    additionalProperties: false
1578cc087a1SEmmanuel Vadot
1588cc087a1SEmmanuel Vadotexamples:
1598cc087a1SEmmanuel Vadot  - |
1608cc087a1SEmmanuel Vadot    #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
1618cc087a1SEmmanuel Vadot
1628d13bc63SEmmanuel Vadot    pmic {
1638d13bc63SEmmanuel Vadot        #address-cells = <1>;
1648d13bc63SEmmanuel Vadot        #size-cells = <0>;
1658d13bc63SEmmanuel Vadot
1668cc087a1SEmmanuel Vadot        pm8841_mpp: mpps@a000 {
1678cc087a1SEmmanuel Vadot            compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
1688d13bc63SEmmanuel Vadot            reg = <0xa000>;
1698d13bc63SEmmanuel Vadot
1708cc087a1SEmmanuel Vadot            gpio-controller;
1718cc087a1SEmmanuel Vadot            #gpio-cells = <2>;
1728cc087a1SEmmanuel Vadot            gpio-ranges = <&pm8841_mpp 0 0 4>;
1738cc087a1SEmmanuel Vadot            gpio-line-names = "VDD_PX_BIAS", "WLAN_LED_CTRL",
1748cc087a1SEmmanuel Vadot                              "BT_LED_CTRL", "GPIO-F";
1758cc087a1SEmmanuel Vadot            interrupt-controller;
1768cc087a1SEmmanuel Vadot            #interrupt-cells = <2>;
1778cc087a1SEmmanuel Vadot
1788cc087a1SEmmanuel Vadot            pinctrl-names = "default";
1798cc087a1SEmmanuel Vadot            pinctrl-0 = <&pm8841_default>;
1808cc087a1SEmmanuel Vadot
1818cc087a1SEmmanuel Vadot            mpp1-state {
1828cc087a1SEmmanuel Vadot                pins = "mpp1";
1838cc087a1SEmmanuel Vadot                function = "digital";
1848cc087a1SEmmanuel Vadot                input-enable;
1858cc087a1SEmmanuel Vadot                power-source = <PM8841_MPP_S3>;
1868cc087a1SEmmanuel Vadot            };
1878cc087a1SEmmanuel Vadot
1888cc087a1SEmmanuel Vadot            default-state {
189cb7aa33aSEmmanuel Vadot                gpio-pins {
1908cc087a1SEmmanuel Vadot                    pins = "mpp1", "mpp2", "mpp3", "mpp4";
1918cc087a1SEmmanuel Vadot                    function = "digital";
1928cc087a1SEmmanuel Vadot                    input-enable;
1938cc087a1SEmmanuel Vadot                    power-source = <PM8841_MPP_S3>;
1948cc087a1SEmmanuel Vadot                };
1958cc087a1SEmmanuel Vadot            };
1968cc087a1SEmmanuel Vadot        };
1978d13bc63SEmmanuel Vadot    };
1988cc087a1SEmmanuel Vadot...
199