MLK-10394 usb: chipidea: otg_fsm: turn off vbus when remove driver
authorLi Jun <jun.li@freescale.com>
Tue, 10 Mar 2015 07:26:46 +0000 (15:26 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:05 +0000 (14:47 -0500)
Currently if remove controller driver while vbus is on, vbus turn off
is missing, thus next time loading controller driver will turn on vbus
again but will not generate AVV irq, finally otg fsm state is mess and
cannot work as host correctly.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit c810ab9697dd912ba2a928659879ace188d31c10)

drivers/usb/chipidea/otg_fsm.c

index d52ed55..c683569 100644 (file)
@@ -864,6 +864,10 @@ int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)
 
 void ci_hdrc_otg_fsm_remove(struct ci_hdrc *ci)
 {
+       /* Turn off vbus if vbus is on */
+       if (ci->fsm.a_vbus_vld)
+               otg_drv_vbus(&ci->fsm, 0);
+
        sysfs_remove_group(&ci->dev->kobj, &inputs_attr_group);
 }