phy: qcom-qmp-combo: fix broken power on
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 14 Nov 2022 08:13:44 +0000 (09:13 +0100)
committerVinod Koul <vkoul@kernel.org>
Thu, 24 Nov 2022 15:32:59 +0000 (21:02 +0530)
commit7a7d86d14d073dfa3429c550667a8e78b99edbd4
tree8b4f49790e670ba4292c813571f2751c1d8fe2e0
parent910dd4883d757af5faac92590f33f0f7da963032
phy: qcom-qmp-combo: fix broken power on

The PHY is powered on during phy-init by setting the SW_PWRDN bit in the
COM_POWER_DOWN_CTRL register and then setting the same bit in the in the
PCS_POWER_DOWN_CONTROL register that belongs to the USB part of the
PHY.

Currently, whether power on succeeds depends on probe order and having
the USB part of the PHY be initialised first. In case the DP part of the
PHY is instead initialised first, the intended power on of the USB block
results in a corrupted DP_PHY register (e.g. DP_PHY_AUX_CFG8).

Add a pointer to the USB part of the PHY to the driver data and use that
to power on the PHY also if the DP part of the PHY is initialised first.

Fixes: 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy")
Cc: stable@vger.kernel.org # 5.10
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221114081346.5116-5-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-qmp-combo.c