OSDN Git Service

phy: qcom-qmp-combo: Introduce orientation switching
authorBjorn Andersson <quic_bjorande@quicinc.com>
Mon, 15 May 2023 03:27:40 +0000 (20:27 -0700)
committerVinod Koul <vkoul@kernel.org>
Fri, 19 May 2023 17:47:19 +0000 (23:17 +0530)
commit2851117f8f4218043e4c05d24494fee66e932cbe
tree5c894920e541cad4dcb3e767b2ce659f62282cb3
parent815891eee668795deea07f5d1eb43e0d6089c930
phy: qcom-qmp-combo: Introduce orientation switching

The data lanes of the QMP PHY is swapped in order to handle changing
orientation of the USB Type-C cable. Register a typec_switch device to
allow a TCPM to configure the orientation.

The newly introduced orientation variable is adjusted based on the
request, and the initialized components are brought down and up again.
To keep track of what parts needs to be cycled new variables to keep
track of the individual init_count is introduced.

Both the USB and the DisplayPort altmode signals are properly switched.
For DisplayPort the controller will after the TCPM having established
orientation power on the PHY, so this is not done implicitly, but for
USB the PHY typically is kept initialized across the switch, and must
therefore then be reinitialized.

This is based on initial work by Wesley Cheng.

Link: https://lore.kernel.org/r/20201009082843.28503-3-wcheng@codeaurora.org/
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
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
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Link: https://lore.kernel.org/r/20230515032743.400170-6-quic_bjorande@quicinc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/Kconfig
drivers/phy/qualcomm/phy-qcom-qmp-combo.c