[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <v4oxbjc4jho5uuz2k2ou4rvycdwifu2wuvbhldgfrm7ord4yqu@7ktz3a4233ff>
Date: Mon, 6 Oct 2025 13:35:08 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
Cc: Neil Armstrong <neil.armstrong@...aro.org>, Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>, Xilin Wu <sophon@...xa.com>,
linux-arm-msm@...r.kernel.org, linux-phy@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/3] phy: qcom: qmp-combo: get the USB3 & DisplayPort
lanes mapping from DT
On Mon, Oct 06, 2025 at 12:08:22PM +0200, Konrad Dybcio wrote:
> On 9/30/25 9:39 AM, Neil Armstrong wrote:
> > The QMP USB3/DP Combo PHY hosts an USB3 phy and a DP PHY on top
> > of a combo glue to route either lanes to the 4 shared physical lanes.
> >
> > The routing of the lanes can be:
> > - 2 DP + 2 USB3
> > - 4 DP
> > - 2 USB3
> >
> > Get the lanes mapping from DT and stop registering the USB-C
> > muxes in favor of a static mode and orientation detemined
> > by the lanes mapping.
> >
> > This allows supporting boards with direct connection of USB3 and
> > DisplayPort lanes to the QMP Combo PHY lanes, not using the
> > USB-C Altmode feature.
> >
> > Signed-off-by: Neil Armstrong <neil.armstrong@...aro.org>
> > ---
>
> [...]
>
> > +struct qmp_combo_lane_mapping {
> > + unsigned int lanes_count;
>
> "num_lanes"?
>
> > + enum typec_orientation orientation;
> > + u32 lanes[4];
> > +};
> > +
> > +static const struct qmp_combo_lane_mapping usb3_data_lanes[] = {
> > + { 2, TYPEC_ORIENTATION_NORMAL, { 1, 0 }},
> > + { 2, TYPEC_ORIENTATION_REVERSE, { 2, 3 }},
> > +};
> > +
> > +static const struct qmp_combo_lane_mapping dp_data_lanes[] = {
> > + { 1, TYPEC_ORIENTATION_NORMAL, { 0 }},
> > + { 1, TYPEC_ORIENTATION_REVERSE, { 3 }},
>
> This is not corroborated by your bindings change ^
>
> I'm also frankly not sure whether it's pin 2 or 3 that 1-lane-DP
> would be TXd on
If we follow the standard, it should be 3 (RX2, TX2, TX1, RX1)
>
> > + { 2, TYPEC_ORIENTATION_NORMAL, { 3, 2 }},
> > + { 2, TYPEC_ORIENTATION_REVERSE, { 0, 1 }},
> > + { 4, TYPEC_ORIENTATION_NORMAL, { 3, 2, 1, 0 }},
> > + { 4, TYPEC_ORIENTATION_REVERSE, { 0, 1, 2, 3 }},
>
> Would it be too cheesy to check orientation based like:
That won't catch weird errors like {0, 2, 1, 3}.
>
> static bool qmpphy_mapping_orient_flipped(u32 *data_lanes)
> {
> return data_lanes[0] == 0;
> }
>
> ?
>
> > - ret = qmp_combo_typec_register(qmp);
> > - if (ret)
> > - goto err_node_put;
> > + qmp->qmpphy_mode = QMPPHY_MODE_USB3DP;
> > +
> > + if (of_find_property(dev->of_node, "mode-switch", NULL) ||
> > + of_find_property(dev->of_node, "orientation-switch", NULL)) {
>
> of_property_present()
>
> Konrad
--
With best wishes
Dmitry
Powered by blists - more mailing lists