linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Prashant Malani <pmalani@chromium.org>
Cc: Stephen Boyd <swboyd@chromium.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Pin-yen Lin <treapking@chromium.org>
Subject: Re: [PATCH 1/2] dt-bindings: usb: Introduce GPIO-based SBU mux
Date: Fri, 19 Aug 2022 17:00:57 -0500	[thread overview]
Message-ID: <YwAIGf59H9iKUhXF@builder.lan> (raw)
In-Reply-To: <CACeCKadP-AZ8OU4A=7CrwAz7yuLvMvjvAcw7K-FORFmkMvx7cA@mail.gmail.com>

On Fri 19 Aug 15:14 CDT 2022, Prashant Malani wrote:

> > This would do that for us, but when all four lanes are connected from
> > the qmp phy directly to the connector we could just as easily have done
> > it with one endpoint.
> >
> >         qmp_phy {
> >                 ports {
> >                         port@0 {
> >                                 reg = <0>;
> >                                 endpoint@0 {
> >                                         reg = <0>;
> >                                         remote-endpoint = <&usb_c_ss>;
> >                                         data-lanes = <1 2 3 0>
> >                                 };
> >                         };
> >                 };
> >         };
> >
> > So should we explicitly have two endpoints in the usb-c-connector for
> > the two pairs all the time, or should we represent that via data-lanes
> > and only split up the connector's endpoint if we need to connect the
> > usb-c-connector to two different endpoints?
> 
> I like 2 endpoints to represent the usb-c-connector, but that doesn't seem
> to be compatible (without introducing `data-lanes`, at least) with all
> the various
> combinations on the remote side, if that remote side is a DRM bridge with DP
> output capability (like it6505 or anx7625).
> That type of DRM bridge supports 1, 2 or 4 lane DP connections.
> 

You can't physically connect 1, 2 or 4 lanes of DP from a DP chip to
your usb-c-connector at the same time as you physically connect 0, 2 or
4 lanes of USB from a USB PHY.

You must either have another component inbetween, or you will connect
some predefined subset of those signals to each output.

In the case where you have a mux of some sort inbetween, that would be
the thing that the usb-c-connector's port@1/endpoint references.

In the case that you hardwire 2 SS lanes to USB and 2 to the DP
hardware, you could specify port@1 with two endpoints and the Type-C
controller would be able to signal both when to turn on/off their
signals. But you wouldn't be able to do orientation switching.

> So, how about 4 endpoints (1 for each SS lane) in the usb-c-connector port@1?
> That should support every conceivable configuration and bridge/PHY hardware.
> and also allows a way to specify any lane remapping (similar to what
> "data lanes" does)
> if that is required.

Wouldn't that prevent you from handling orientation switching, given
that the graph is static?

> Then we are consistent with what an endpoint represents, regardless of whether
> the DRM bridge has a DP panel (1,2 or 4 lane) or Type-C connector  (2
> or 4 lane) on its output side.

We can represent that perfectly fine with the proposed bindings.
In the USB Type-C case I have:

dp-controller {
    phys = <&qmp>;

    ports {
       dp_hpd: port@1 {
            endpoint = <&port_1_endpoint_1>;
        };
    };
};

qmp: qmp {
    port {
        qmp_out: endpoint {
            remote-endpoint = <&port_1_endpoint_0>;
        };
    };
};

connector {
    compatible = "usb-c-connector";
    ports {
        port@1 {
            port_1_endpoint_0: endpoint@0 {
                remote-endpoint = <&qmp_out>;
            };
            port_1_endpoint_1: endpoint@1 {
                remote-endpoint = <&dp_hpd>;
            };
        };
    };
};

The dp-controller binding is defined to have the output on port@1 and by
implementing a drm_bridge in the controller backing the connector it
will find that. The controller can use the links to inform the QMP about
muxing and orientation switching.

In the case of DP we have:

dp-controller {
    phys = <&dp_phy>;

    ports {
       dp_hpd: port@1 {
            endpoint = <&dp_connector>;
        };
    };
};

dp_phy: dp-phy {
    compatible = "qcom,dp-phy";
};

connector {
    compatible = "dp-connector";
    port {
        dp_connector: endpoint@0 {
            remote-endpoint = <&dp_hpd>;
        };
    };
};


The link between the dp_phy and the dp connector could be expressed
further, but this is a binding that already exists...

Regards,
Bjorn

  parent reply	other threads:[~2022-08-19 22:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 20:47 [PATCH 0/2] usb: typec: mux: GPIO-based SBU mux Bjorn Andersson
2022-08-10 20:47 ` [PATCH 1/2] dt-bindings: usb: Introduce " Bjorn Andersson
2022-08-11  9:14   ` Krzysztof Kozlowski
2022-08-14 21:01     ` Rob Herring
2022-08-17 23:00       ` Bjorn Andersson
2022-08-19  1:09         ` Stephen Boyd
2022-08-19 20:14           ` Prashant Malani
2022-08-19 20:49             ` Stephen Boyd
2022-08-19 21:39               ` Bjorn Andersson
2022-08-19 22:18                 ` Prashant Malani
2022-08-20  4:04                   ` Bjorn Andersson
2022-08-23 18:21                     ` Prashant Malani
2022-08-19 22:00             ` Bjorn Andersson [this message]
2022-08-19 22:55               ` Prashant Malani
2022-08-20  4:09                 ` Bjorn Andersson
2022-08-23 18:54                   ` Prashant Malani
2022-08-26  3:02                     ` Bjorn Andersson
2022-08-19 21:26           ` Bjorn Andersson
2022-08-20  3:51             ` Stephen Boyd
2022-08-20  4:56               ` Bjorn Andersson
2022-08-26  1:49                 ` Stephen Boyd
2022-08-10 20:47 ` [PATCH 2/2] usb: typec: mux: " Bjorn Andersson

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=YwAIGf59H9iKUhXF@builder.lan \
    --to=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pmalani@chromium.org \
    --cc=robh@kernel.org \
    --cc=swboyd@chromium.org \
    --cc=treapking@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).