mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
phy: rockchip: inno-usb2: add phy reset during resume
On most of rockchip platforms, the usb2 phy lost power
during deep sleep. So we need to reset phy during pm
resume to recovery clock to usb controller.
When do sleeptest on rk3588 evb1, without this patch,
it may fail in ehci_resume or ohci_resume, because
the ehci/ohci controller can't get clock from usb2 phy.
Note that the phy reset is optional in devicetree, so
it needs to check the reset_control of phy before phy
reset operation to avoid unnecessary delay.
Fixes: ba8a6e65a7 ("phy: rockchip: inno_usb2: only reset phy if deassert iddq for rk3588")
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I31dee9baea472d9e314eca6cb9f78b2aab0e5353
This commit is contained in:
@@ -403,6 +403,9 @@ static int rockchip_usb2phy_reset(struct rockchip_usb2phy *rphy)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!rphy->phy_reset)
|
||||
return 0;
|
||||
|
||||
ret = reset_control_assert(rphy->phy_reset);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -2916,6 +2919,13 @@ static int rockchip_usb2phy_pm_resume(struct device *dev)
|
||||
if (device_may_wakeup(rphy->dev))
|
||||
wakeup_enable = true;
|
||||
|
||||
/*
|
||||
* PHY lost power in suspend, it needs to reset
|
||||
* PHY to recovery clock to usb controller.
|
||||
*/
|
||||
if (!wakeup_enable)
|
||||
rockchip_usb2phy_reset(rphy);
|
||||
|
||||
if (phy_cfg->phy_tuning)
|
||||
ret = phy_cfg->phy_tuning(rphy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user