All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: linux@roeck-us.net, heikki.krogerus@linux.intel.com,
	gregkh@linuxfoundation.org, andersson@kernel.org,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	luca.weiss@fairphone.com, linux-usb@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org
Cc: caleb.connolly@linaro.org, bryan.odonoghue@linaro.org,
	konrad.dybcio@linaro.org, subbaram@quicinc.com,
	jackp@quicinc.com, robertom@qti.qualcomm.com,
	Wesley Cheng <wcheng@codeaurora.org>
Subject: [PATCH v6 05/13] dt-bindings: usb: Add Qualcomm PMIC Type-C
Date: Mon,  1 May 2023 13:11:03 +0100	[thread overview]
Message-ID: <20230501121111.1058190-6-bryan.odonoghue@linaro.org> (raw)
In-Reply-To: <20230501121111.1058190-1-bryan.odonoghue@linaro.org>

Add a description for the Type-C silicon interface inside Qualcomm's
PM8150b hardware block.

Based on original work by Wesley.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 .../bindings/usb/qcom,pmic-typec.yaml         | 190 ++++++++++++++++++
 1 file changed, 190 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml

diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
new file mode 100644
index 0000000000000..17c5c244c1701
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
@@ -0,0 +1,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_controller_role_switch_in>;
+                        };
+                    };
+                };
+            };
+        };
+    };
+
+    usb_controller {
+        dr_mode = "otg";
+        usb-role-switch;
+        port {
+            usb_controller_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>;
+            };
+        };
+    };
+
+...
-- 
2.39.2


  parent reply	other threads:[~2023-05-01 12:11 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-01 12:10 [PATCH v6 00/13] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
2023-05-01 12:10 ` [PATCH v6 01/13] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required Bryan O'Donoghue
2023-05-01 12:11 ` [PATCH v6 02/13] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark regulator-*-microamp required Bryan O'Donoghue
2023-05-01 12:11 ` [PATCH v6 03/13] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as optional Bryan O'Donoghue
2023-05-01 12:11 ` [PATCH v6 04/13] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports Bryan O'Donoghue
2023-05-02 10:45   ` Krzysztof Kozlowski
2023-05-02 10:51     ` Krzysztof Kozlowski
2023-05-01 12:11 ` Bryan O'Donoghue [this message]
2023-05-02 10:56   ` [PATCH v6 05/13] dt-bindings: usb: Add Qualcomm PMIC Type-C Krzysztof Kozlowski
2023-05-01 12:11 ` [PATCH v6 06/13] dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types Bryan O'Donoghue
2023-05-01 12:11 ` [PATCH v6 07/13] usb: typec: qcom: Add Qualcomm PMIC Type-C driver Bryan O'Donoghue
2023-05-01 13:31   ` Guenter Roeck
2023-05-01 17:50   ` Caleb Connolly
2023-05-01 12:11 ` [PATCH v6 08/13] arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching Bryan O'Donoghue
2023-05-02 11:01   ` Konrad Dybcio
2023-05-01 12:11 ` [PATCH v6 09/13] arm64: dts: qcom: pm8150b: Add a TCPM description Bryan O'Donoghue
2023-05-01 12:11 ` [PATCH v6 10/13] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost Bryan O'Donoghue
2023-05-02 10:56   ` Konrad Dybcio
2023-05-01 12:11 ` [PATCH v6 11/13] arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM Bryan O'Donoghue
2023-05-01 15:28   ` Jianhua Lu
2023-05-02 10:57   ` Konrad Dybcio
2023-05-01 12:11 ` [PATCH v6 12/13] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 Bryan O'Donoghue
2023-05-01 15:21   ` Jianhua Lu
2023-05-01 15:53     ` Bryan O'Donoghue
2023-05-01 16:04       ` Jianhua Lu
2023-05-01 15:30   ` Jianhua Lu
2023-05-02 11:00   ` Konrad Dybcio
2023-05-02 11:03     ` Bryan O'Donoghue
2023-05-02 11:13       ` Konrad Dybcio
2023-05-02 11:16         ` Bryan O'Donoghue
2023-05-02 11:47           ` Konrad Dybcio
2023-05-02 12:10             ` Bryan O'Donoghue
2023-05-07 21:09             ` Bryan O'Donoghue
2023-05-01 12:11 ` [PATCH v6 13/13] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy Bryan O'Donoghue
2023-05-01 15:34   ` Jianhua Lu
2023-05-01 16:00     ` Bryan O'Donoghue
2023-05-01 15:37   ` Jianhua Lu
2023-05-01 17:04     ` Bryan O'Donoghue
2023-05-02 11:01   ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230501121111.1058190-6-bryan.odonoghue@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=andersson@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jackp@quicinc.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=luca.weiss@fairphone.com \
    --cc=robertom@qti.qualcomm.com \
    --cc=robh+dt@kernel.org \
    --cc=subbaram@quicinc.com \
    --cc=wcheng@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.