From 9c63b52a6143ed3a88a6f87788038d77639cbd44 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Tue, 10 Mar 2015 15:26:46 +0800 Subject: [PATCH] MLK-10394 usb: chipidea: otg_fsm: turn off vbus when remove driver 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 (cherry picked from commit c810ab9697dd912ba2a928659879ace188d31c10) --- drivers/usb/chipidea/otg_fsm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index d52ed55940d9..c683569cc6d7 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c @@ -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); } -- 2.17.1