Documentation / devicetree / bindings / usb / qcom,pmic-typec.yaml


Based on kernel version 6.8. Page generated on 2024-03-11 21:26 EST.

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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/qcom,pmic-typec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm PMIC based USB Type-C block

maintainers:
  - Bryan O'Donoghue <bryan.odonoghue@linaro.org>

description:
  Qualcomm PMIC Type-C block

properties:
  compatible:
    enum:
      - qcom,pm8150b-typec

  connector:
    type: object
    $ref: /schemas/connector/usb-connector.yaml#
    unevaluatedProperties: false

  reg:
    description: Type-C port and pdphy SPMI register base offsets
    maxItems: 2

  interrupts:
    items:
      - description: Type-C CC attach notification, VBUS error, tCCDebounce done
      - description: Type-C VCONN powered
      - description: Type-C CC state change
      - description: Type-C VCONN over-current
      - description: Type-C VBUS state change
      - description: Type-C Attach/detach notification
      - description: Type-C Legacy cable detect
      - description: Type-C Try.Src Try.Snk state change
      - description: Power Domain Signal TX - HardReset or CableReset signal TX
      - description: Power Domain Signal RX - HardReset or CableReset signal RX
      - description: Power Domain TX complete
      - description: Power Domain RX complete
      - description: Power Domain TX fail
      - description: Power Domain TX message discard
      - description: Power Domain RX message discard
      - description: Power Domain Fast Role Swap event

  interrupt-names:
    items:
      - const: or-rid-detect-change
      - const: vpd-detect
      - const: cc-state-change
      - const: vconn-oc
      - const: vbus-change
      - const: attach-detach
      - const: legacy-cable-detect
      - const: try-snk-src-detect
      - const: sig-tx
      - const: sig-rx
      - const: msg-tx
      - const: msg-rx
      - const: msg-tx-failed
      - const: msg-tx-discarded
      - const: msg-rx-discarded
      - const: fr-swap

  vdd-vbus-supply:
    description: VBUS power supply.

  vdd-pdphy-supply:
    description: VDD regulator supply to the PDPHY.

  port:
    $ref: /schemas/graph.yaml#/properties/port
    description:
      Contains a port which produces data-role switching messages.

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names
  - vdd-vbus-supply
  - vdd-pdphy-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/usb/pd.h>
 
    pmic {
        #address-cells = <1>;
        #size-cells = <0>;
 
        pm8150b_typec: typec@1500 {
            compatible = "qcom,pm8150b-typec";
            reg = <0x1500>,
                  <0x1700>;
 
            interrupts = <0x2 0x15 0x00 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x15 0x01 IRQ_TYPE_EDGE_BOTH>,
                         <0x2 0x15 0x02 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x15 0x03 IRQ_TYPE_EDGE_BOTH>,
                         <0x2 0x15 0x04 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x15 0x05 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x15 0x06 IRQ_TYPE_EDGE_BOTH>,
                         <0x2 0x15 0x07 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x00 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x01 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x02 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x03 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x04 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x05 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x06 IRQ_TYPE_EDGE_RISING>,
                         <0x2 0x17 0x07 IRQ_TYPE_EDGE_RISING>;
 
            interrupt-names = "or-rid-detect-change",
                              "vpd-detect",
                              "cc-state-change",
                              "vconn-oc",
                              "vbus-change",
                              "attach-detach",
                              "legacy-cable-detect",
                              "try-snk-src-detect",
                              "sig-tx",
                              "sig-rx",
                              "msg-tx",
                              "msg-rx",
                              "msg-tx-failed",
                              "msg-tx-discarded",
                              "msg-rx-discarded",
                              "fr-swap";
 
            vdd-vbus-supply = <&pm8150b_vbus>;
            vdd-pdphy-supply = <&vreg_l2a_3p1>;
 
            connector {
                compatible = "usb-c-connector";
 
                power-role = "source";
                data-role = "dual";
                self-powered;
 
                source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_DUAL_ROLE |
                               PDO_FIXED_USB_COMM | PDO_FIXED_DATA_SWAP)>;
 
                ports {
                    #address-cells = <1>;
                    #size-cells = <0>;
 
                    port@0 {
                        reg = <0>;
                        pmic_typec_mux_out: endpoint {
                            remote-endpoint = <&usb_phy_typec_mux_in>;
                        };
                    };
 
                    port@1 {
                        reg = <1>;
                        pmic_typec_role_switch_out: endpoint {
                            remote-endpoint = <&usb_role_switch_in>;
                        };
                    };
                };
            };
        };
    };
 
    usb {
        dr_mode = "otg";
        usb-role-switch;
        port {
            usb_role_switch_in: endpoint {
                remote-endpoint = <&pmic_typec_role_switch_out>;
            };
        };
    };
 
    usb-phy {
        orientation-switch;
        port {
            usb_phy_typec_mux_in: endpoint {
                remote-endpoint = <&pmic_typec_mux_out>;
            };
        };
    };

...