MLK-12344-3 usb: chipidea: update power lost handling for gadget

After we put gadget disconnect and connect in id switch handling,
update power lost work accordingly.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
This commit is contained in:
Li Jun
2016-02-03 16:09:57 +08:00
parent 79aab6fc3c
commit fd49596ece
2 changed files with 5 additions and 7 deletions

View File

@ -835,11 +835,13 @@ static void ci_start_new_role(struct ci_hdrc *ci)
{
enum ci_role role = ci_get_role(ci);
if (ci->role != role)
if (ci->role != role) {
ci_handle_id_switch(ci);
if (role == CI_ROLE_GADGET)
} else if (role == CI_ROLE_GADGET) {
if (ci->vbus_active)
usb_gadget_vbus_disconnect(&ci->gadget);
ci_handle_vbus_connected(ci);
}
}
static void ci_power_lost_work(struct work_struct *work)

View File

@ -2077,10 +2077,6 @@ static void udc_suspend_for_power_lost(struct ci_hdrc *ci)
/* Power lost with device mode */
static void udc_resume_from_power_lost(struct ci_hdrc *ci)
{
/* Force disconnect if power lost with vbus on */
if (!ci_otg_is_fsm_mode(ci) && ci->vbus_active)
usb_gadget_vbus_disconnect(&ci->gadget);
if (ci->is_otg)
hw_write_otgsc(ci, OTGSC_BSVIS | OTGSC_BSVIE,
OTGSC_BSVIS | OTGSC_BSVIE);