Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: k1-usb: add disconnect function support

A disconnect status BIT of USB2 PHY need to be cleared, otherwise
it will fail to work properly during next connection when devices
connect to roothub directly.

Fixes: fe4bc1a08638 ("phy: spacemit: support K1 USB2.0 PHY controller")
Signed-off-by: Yixun Lan <dlan@kernel.org>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/20260216152653.25244-1-dlan@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Yixun Lan and committed by
Vinod Koul
f0cf0a88 a258d843

+14
+14
drivers/phy/spacemit/phy-k1-usb2.c
··· 48 48 #define PHY_CLK_HSTXP_EN BIT(3) /* clock hstxp enable */ 49 49 #define PHY_HSTXP_MODE BIT(4) /* 0: force en_txp to be 1; 1: no force */ 50 50 51 + #define PHY_K1_HS_HOST_DISC 0x40 52 + #define PHY_K1_HS_HOST_DISC_CLR BIT(0) 53 + 51 54 #define PHY_PLL_DIV_CFG 0x98 52 55 #define PHY_FDIV_FRACT_8_15 GENMASK(7, 0) 53 56 #define PHY_FDIV_FRACT_16_19 GENMASK(11, 8) ··· 145 142 return 0; 146 143 } 147 144 145 + static int spacemit_usb2phy_disconnect(struct phy *phy, int port) 146 + { 147 + struct spacemit_usb2phy *sphy = phy_get_drvdata(phy); 148 + 149 + regmap_update_bits(sphy->regmap_base, PHY_K1_HS_HOST_DISC, 150 + PHY_K1_HS_HOST_DISC_CLR, PHY_K1_HS_HOST_DISC_CLR); 151 + 152 + return 0; 153 + } 154 + 148 155 static const struct phy_ops spacemit_usb2phy_ops = { 149 156 .init = spacemit_usb2phy_init, 150 157 .exit = spacemit_usb2phy_exit, 158 + .disconnect = spacemit_usb2phy_disconnect, 151 159 .owner = THIS_MODULE, 152 160 }; 153 161