Message ID | 20230510031930.1996020-1-quic_bjorande@quicinc.com |
---|---|
Headers | show |
Series | phy: qcom-qmp-combo: Support orientation switching | expand |
On Tue, May 09, 2023 at 08:19:25PM -0700, Bjorn Andersson wrote: > The phy core ensures mutual exclusion across the ops for a given phy, > but the upcoming introduction of USB Type-C orientation switching might > race with the DisplayPort phy operations. So extend the mutual exclusion > to cover the remaining ops as well, to avoid concurrent reconfiguration > of the hardware. > > Reported-by: Johan Hovold <johan@kernel.org> > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Johan
On Tue, May 09, 2023 at 08:19:26PM -0700, Bjorn Andersson wrote: > In multiple places throughout the driver code has been written in > prepration for handling of orientation switching. > > Introduce a typec_orientation in qmp_combo and fill out the various > "placeholders" with the associated logic. By initializing the > orientation to "normal" this change has no functional impact, but > reduces the size of the upcoming introduction of dynamic orientation > switching. > > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> > Tested-by: Abel Vesa <abel.vesa@linaro.org> > Tested-by: Steev Klimaszewski <steev@kali.org> > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on HDK8450 > Tested-by: Johan Hovold <johan+linaro@kernel.org> # X13s > --- > > Changes since v1: > - X-mas in qmp_combo_configure_dp_mode() > > drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 54 +++++++++++++---------- > 1 file changed, 30 insertions(+), 24 deletions(-) > static bool qmp_combo_configure_dp_mode(struct qmp_combo *qmp) > { > + bool reverse = qmp->orientation == TYPEC_ORIENTATION_REVERSE; Nit: I still think parentheses around the right-hand side would improve readability. > + const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; > u32 val; > - bool reverse = false; > @@ -2235,7 +2236,7 @@ static int qmp_v4_configure_dp_phy(struct qmp_combo *qmp) > { > const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; > u32 bias0_en, drvr0_en, bias1_en, drvr1_en; > - bool reverse = false; > + bool reverse = qmp->orientation == TYPEC_ORIENTATION_REVERSE; Same here and below. And maintaining reverse xmas style throughout the driver would be nice for consistency too. > u32 status; > int ret; Looks good otherwise: Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Johan
On Tue, May 09, 2023 at 08:19:28PM -0700, Bjorn Andersson wrote: > The QMP combo PHY sits in an of_graph connected between the DisplayPort > controller and a USB Type-C connector (or possibly a redriver). > > The TCPM needs to be able to convey the HPD signal to the DisplayPort > controller, but no directly link is provided by DeviceTree so the signal > needs to "pass through" the QMP combo phy. > > Handle this by introducing a drm_bridge which upon initialization finds > the next bridge (i.e. the usb-c-connector) and chain this together. This > way HPD changes in the connector will propagate to the DisplayPort > driver. > > The connector bridge is resolved lazily, as the TCPM is expected to be > able to resolve the typec mux and switch at probe time, so the QMP combo > phy will probe before the TCPM. > > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > Acked-by: Neil Armstrong <neil.armstrong@linaro.org> > Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > Tested-by: Abel Vesa <abel.vesa@linaro.org> > Tested-by: Steev Klimaszewski <steev@kali.org> > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on HDK8450 > Tested-by: Johan Hovold <johan+linaro@kernel.org> # X13s > --- > > Changes since v1: > - Wrap DRM-related code in CONFIG_DRM guard > - Inroduce DRM-dependencies in Kconfig > - Dropped dev_err_probe() usage Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
On Tue, May 09, 2023 at 08:19:29PM -0700, Bjorn Andersson wrote: > With support for the QMP combo phy to react to USB Type-C switch events, > introduce it as the next hop for the SuperSpeed lanes of the two USB > Type-C connectors, and connect the output of the DisplayPort controller > to the QMP combo phy. > > This allows the TCPM to perform orientation switching of both USB and > DisplayPort signals. > > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > Tested-by: Abel Vesa <abel.vesa@linaro.org> > Tested-by: Steev Klimaszewski <steev@kali.org> > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on HDK8450 > Tested-by: Johan Hovold <johan+linaro@kernel.org> # X13s > --- > > Changes since v1: > - DP input is port@2 Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
On Tue, May 09, 2023 at 08:19:30PM -0700, Bjorn Andersson wrote: > Following the CRD, connect the two QMP phys inbetween the USB Type-C > connectors and the DisplayPort controller, to handle orientation > switching. > > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > Tested-by: Abel Vesa <abel.vesa@linaro.org> > Tested-by: Steev Klimaszewski <steev@kali.org> > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on HDK8450 > Tested-by: Johan Hovold <johan+linaro@kernel.org> # X13s > --- > > Changes since v1: > - None Reviewed-by: Johan Hovold <johan+linaro@kernel.org>