[PATCH 04/10] phy: qcom-usb-hsic: engage HSIC mode from phy_calibrate()

From: Dmitry Baryshkov

Date: Mon Aug 10 2026 - 12:34:27 EST


The PHY power-on sequence ends by engaging HSIC mode. With chipidea,
power-on runs before the host is started, and the HSIC connect of an
already-present device is latched at the moment HSIC mode is engaged:
performed before the host runs (and before an onboard hub is taken out
of reset), the connect is lost and the device is never seen. This is
why the APQ8074 dragonboard USB4604 hub never enumerated on mainline
while the vendor kernel - which performs the whole PHY sequence after
usb_add_hcd() - sees it on every boot.

Keep the calibration setup and the pad mux in power-on, and move the
HSIC mode enable (and the auto-resume disable) into the calibrate op,
which the chipidea host now invokes after the host is up and the
onboard device reset has been released.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
---
drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
index b670ec364a2d..e0637522eb82 100644
--- a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
+++ b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
@@ -63,17 +63,6 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy)
}

ret = pinctrl_select_state(uphy->pctl, pins_default);
- if (ret)
- goto err_ulpi;
-
- /* Enable HSIC mode in HSIC_CFG register */
- ret = ulpi_write(ulpi, ULPI_SET(ULPI_HSIC_CFG), 0x01);
- if (ret)
- goto err_ulpi;
-
- /* Disable auto-resume */
- ret = ulpi_write(ulpi, ULPI_CLR(ULPI_IFC_CTRL),
- ULPI_IFC_CTRL_AUTORESUME);
if (ret)
goto err_ulpi;

@@ -85,6 +74,26 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy)
return ret;
}

+static int qcom_usb_hsic_phy_calibrate(struct phy *phy)
+{
+ struct qcom_usb_hsic_phy *uphy = phy_get_drvdata(phy);
+ struct ulpi *ulpi = uphy->ulpi;
+ int ret;
+
+ /*
+ * Engage HSIC mode only now, with the host running and the
+ * downstream device out of reset: the connect is latched at this
+ * point, and a hub that has already booted asserts it right away.
+ */
+ ret = ulpi_write(ulpi, ULPI_SET(ULPI_HSIC_CFG), 0x01);
+ if (ret)
+ return ret;
+
+ /* Disable auto-resume */
+ return ulpi_write(ulpi, ULPI_CLR(ULPI_IFC_CTRL),
+ ULPI_IFC_CTRL_AUTORESUME);
+}
+
static int qcom_usb_hsic_phy_power_off(struct phy *phy)
{
struct qcom_usb_hsic_phy *uphy = phy_get_drvdata(phy);
@@ -97,6 +106,7 @@ static int qcom_usb_hsic_phy_power_off(struct phy *phy)

static const struct phy_ops qcom_usb_hsic_phy_ops = {
.power_on = qcom_usb_hsic_phy_power_on,
+ .calibrate = qcom_usb_hsic_phy_calibrate,
.power_off = qcom_usb_hsic_phy_power_off,
.owner = THIS_MODULE,
};

--
2.47.3