Skip to content

Commit ba8a6e6

Browse files
wuliangfengrkhuangtao
authored andcommitted
phy: rockchip: inno_usb2: only reset phy if deassert iddq for rk3588
The current code always reset the usb2 phy in the rk3588_usb2phy_tuning(), this cause the usb core reset the device which connected to the usb2 host interface during pm resume. Actually, it only needs to reset the phy when it exit from iddq mode, so add this patch to reset phy more reasonably, and avoid reset usb device during pm resume. Signed-off-by: William Wu <[email protected]> Change-Id: I296636321d0cbe6b7ee7be9bd1614237a34312e9
1 parent f550285 commit ba8a6e6

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

drivers/phy/rockchip/phy-rockchip-inno-usb2.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,18 +2692,26 @@ static int rk3568_vbus_detect_control(struct rockchip_usb2phy *rphy, bool en)
26922692

26932693
static int rk3588_usb2phy_tuning(struct rockchip_usb2phy *rphy)
26942694
{
2695+
unsigned int reg;
26952696
int ret = 0;
26962697

2697-
/* Deassert SIDDQ to power on analog block */
2698-
ret = regmap_write(rphy->grf, 0x0008,
2699-
GENMASK(29, 29) | 0x0000);
2698+
/* Read the SIDDQ control register */
2699+
ret = regmap_read(rphy->grf, 0x0008, &reg);
27002700
if (ret)
27012701
return ret;
27022702

2703-
/* Do reset after exit IDDQ mode */
2704-
ret = rockchip_usb2phy_reset(rphy);
2705-
if (ret)
2706-
return ret;
2703+
if (reg & BIT(13)) {
2704+
/* Deassert SIDDQ to power on analog block */
2705+
ret = regmap_write(rphy->grf, 0x0008,
2706+
GENMASK(29, 29) | 0x0000);
2707+
if (ret)
2708+
return ret;
2709+
2710+
/* Do reset after exit IDDQ mode */
2711+
ret = rockchip_usb2phy_reset(rphy);
2712+
if (ret)
2713+
return ret;
2714+
}
27072715

27082716
if (rphy->phy_cfg->reg == 0x0000) {
27092717
/*

0 commit comments

Comments
 (0)