Skip to content

Commit

Permalink
phy: rockchip: inno_usb2: only reset phy if deassert iddq for rk3588
Browse files Browse the repository at this point in the history
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 <william.wu@rock-chips.com>
Change-Id: I296636321d0cbe6b7ee7be9bd1614237a34312e9
  • Loading branch information
wuliangfeng authored and rkhuangtao committed Jul 20, 2022
1 parent f550285 commit ba8a6e6
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions drivers/phy/rockchip/phy-rockchip-inno-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2692,18 +2692,26 @@ static int rk3568_vbus_detect_control(struct rockchip_usb2phy *rphy, bool en)

static int rk3588_usb2phy_tuning(struct rockchip_usb2phy *rphy)
{
unsigned int reg;
int ret = 0;

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

/* Do reset after exit IDDQ mode */
ret = rockchip_usb2phy_reset(rphy);
if (ret)
return ret;
if (reg & BIT(13)) {
/* Deassert SIDDQ to power on analog block */
ret = regmap_write(rphy->grf, 0x0008,
GENMASK(29, 29) | 0x0000);
if (ret)
return ret;

/* Do reset after exit IDDQ mode */
ret = rockchip_usb2phy_reset(rphy);
if (ret)
return ret;
}

if (rphy->phy_cfg->reg == 0x0000) {
/*
Expand Down

0 comments on commit ba8a6e6

Please sign in to comment.