1
0
Fork 0

MLK-19240 usb: chipidea: udc: keep suspended after charger detection

If the otg port is only for charging, we don't need keep the usb
port active, so let's keep it suspended after charger detection.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
pull/10/head
Li Jun 2018-10-30 09:44:47 +08:00
parent fb214bbcec
commit b3b9a278d0
1 changed files with 4 additions and 7 deletions

View File

@ -2013,11 +2013,10 @@ int ci_usb_charger_connect(struct ci_hdrc *ci, int is_active)
{
int ret = 0;
if (is_active)
pm_runtime_get_sync(ci->dev);
if (!(ci->platdata->flags & CI_HDRC_PHY_CHARGER_DETECTION))
goto out;
return 0;
pm_runtime_get_sync(ci->dev);
if (ci->usb_phy->charger_detect) {
usb_phy_set_charger_state(ci->usb_phy, is_active ?
@ -2027,10 +2026,8 @@ int ci_usb_charger_connect(struct ci_hdrc *ci, int is_active)
CI_HDRC_CONTROLLER_VBUS_EVENT);
schedule_work(&ci->usb_phy->chg_work);
}
out:
if (!is_active)
pm_runtime_put_sync(ci->dev);
pm_runtime_put_sync(ci->dev);
return ret;
}