diff mbox series

[1/7] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Add ports and orientation-switch

Message ID 20230425034010.3789376-2-quic_bjorande@quicinc.com
State Superseded
Headers show
Series [1/7] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Add ports and orientation-switch | expand

Commit Message

Bjorn Andersson April 25, 2023, 3:40 a.m. UTC
The QMP combo phy can be connected to a TCPM, a USB controller and a
DisplayPort controller for handling USB Type-C orientation switching
and propagating HPD signals.

Extend the binding to allow these connections to be described.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml    | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)

Comments

Bjorn Andersson April 27, 2023, 7:52 p.m. UTC | #1
On Wed, Apr 26, 2023 at 11:21:29AM +0100, Bryan O'Donoghue wrote:
> On Tue, Apr 25, 2023 at 4:40 AM Bjorn Andersson
> <quic_bjorande@quicinc.com> wrote:
> >
> > The QMP combo phy can be connected to a TCPM, a USB controller and a
> > DisplayPort controller for handling USB Type-C orientation switching
> > and propagating HPD signals.
> >
> > Extend the binding to allow these connections to be described.
> >
> > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> > ---
> >  .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml    | 51 +++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
> > index 3cd5fc3e8fab..c037ac90ce7f 100644
> > --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
> > +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
> > @@ -60,6 +60,26 @@ properties:
> >      description:
> >        See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h
> >
> > +  orientation-switch:
> > +    description:
> > +      Flag the PHY as possible handler of USB Type-C orientation switching
> > +    type: boolean
> > +
> > +  ports:
> > +    $ref: /schemas/graph.yaml#/properties/ports
> > +    properties:
> > +      port@0:
> > +        $ref: /schemas/graph.yaml#/properties/port
> > +        description: Output endpoint of the PHY
> > +
> > +      port@1:
> > +        $ref: /schemas/graph.yaml#/$defs/port-base
> > +        description: Incoming endpoint from the USB controller
> 
> Do you really need this one ?
> 
> The controller doesn't process orientation switching.
> 

I don't have a need for it, as we can deal with role switching by
connecting connector/port@0 to the dwc3.

But if we ever have a need to describe the dwc3 -> QMP -> connector path
in the of_graph I think it would look prettier to have USB input as
port@1 and DP input as port@2...

Do you have a concern with keeping it around in the DT (the
implementation doesn't need to care)?

Regards,
Bjorn
Bryan O'Donoghue May 3, 2023, 8:37 p.m. UTC | #2
On 27/04/2023 20:52, Bjorn Andersson wrote:
> Do you have a concern with keeping it around in the DT (the
> implementation doesn't need to care)?

Nope, its fine with me.
Bjorn Andersson May 4, 2023, 2:51 p.m. UTC | #3
On Thu, May 04, 2023 at 03:50:53PM +0200, Neil Armstrong wrote:
> On 27/04/2023 21:52, Bjorn Andersson wrote:
> > On Wed, Apr 26, 2023 at 11:21:29AM +0100, Bryan O'Donoghue wrote:
> > > On Tue, Apr 25, 2023 at 4:40 AM Bjorn Andersson
> > > <quic_bjorande@quicinc.com> wrote:
> > > > 
> > > > The QMP combo phy can be connected to a TCPM, a USB controller and a
> > > > DisplayPort controller for handling USB Type-C orientation switching
> > > > and propagating HPD signals.
> > > > 
> > > > Extend the binding to allow these connections to be described.
> > > > 
> > > > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> > > > ---
> > > >   .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml    | 51 +++++++++++++++++++
> > > >   1 file changed, 51 insertions(+)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
> > > > index 3cd5fc3e8fab..c037ac90ce7f 100644
> > > > --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
> > > > +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
> > > > @@ -60,6 +60,26 @@ properties:
> > > >       description:
> > > >         See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h
> > > > 
> > > > +  orientation-switch:
> > > > +    description:
> > > > +      Flag the PHY as possible handler of USB Type-C orientation switching
> > > > +    type: boolean
> > > > +
> > > > +  ports:
> > > > +    $ref: /schemas/graph.yaml#/properties/ports
> > > > +    properties:
> > > > +      port@0:
> > > > +        $ref: /schemas/graph.yaml#/properties/port
> > > > +        description: Output endpoint of the PHY
> > > > +
> > > > +      port@1:
> > > > +        $ref: /schemas/graph.yaml#/$defs/port-base
> > > > +        description: Incoming endpoint from the USB controller
> > > 
> > > Do you really need this one ?
> > > 
> > > The controller doesn't process orientation switching.
> > > 
> > 
> > I don't have a need for it, as we can deal with role switching by
> > connecting connector/port@0 to the dwc3.
> > 
> > But if we ever have a need to describe the dwc3 -> QMP -> connector path
> > in the of_graph I think it would look prettier to have USB input as
> > port@1 and DP input as port@2...
> 
> I think it would be great to have port@1 for USB SS and port@2 for DP,
> otherwise we need to add 2 endpoints as I sent in
> https://lore.kernel.org/all/20230503-topic-sm8450-graphics-dp-next-v1-1-d1ee9397f2a6@linaro.org/
> since we split USB HS and SS streams on SM8[345]50 platforms.
> 

Right, so let's keep port@1 and port@2 in the binding, and then we can
choose to connect port@1 to DWC3 or not...

Regards,
Bjorn

> > 
> > Do you have a concern with keeping it around in the DT (the
> > implementation doesn't need to care)?
> > 
> > Regards,
> > Bjorn
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
index 3cd5fc3e8fab..c037ac90ce7f 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
@@ -60,6 +60,26 @@  properties:
     description:
       See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h
 
+  orientation-switch:
+    description:
+      Flag the PHY as possible handler of USB Type-C orientation switching
+    type: boolean
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Output endpoint of the PHY
+
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        description: Incoming endpoint from the USB controller
+
+      port@2:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        description: Incoming endpoint from the DisplayPort controller
+
 required:
   - compatible
   - reg
@@ -98,6 +118,37 @@  examples:
       vdda-phy-supply = <&vreg_l9d>;
       vdda-pll-supply = <&vreg_l4d>;
 
+      orientation-switch;
+
       #clock-cells = <1>;
       #phy-cells = <1>;
+
+      ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          port@0 {
+              reg = <0>;
+
+              endpoint {
+                  remote-endpoint = <&typec_connector_ss>;
+              };
+          };
+
+          port@1 {
+              reg = <1>;
+
+              endpoint {
+                  remote-endpoint = <&dwc3_ss_out>;
+              };
+          };
+
+          port@2 {
+              reg = <2>;
+
+              endpoint {
+                  remote-endpoint = <&mdss_dp_out>;
+              };
+          };
+      };
     };