]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00215792 USB:fix gadget issue when boot kernel with USB connected
authormake shi <b15407@freescale.com>
Thu, 5 Jul 2012 05:57:59 +0000 (13:57 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:12:21 +0000 (14:12 +0200)
commitf98f20e68945187b1946c17363caf83da52ab5c5
tree7449146ed221be5812fcba505100052735b7ba82
parentd757bda6b059fa6f83b824f43fddaf5273282eaf
ENGR00215792 USB:fix gadget issue when boot kernel with USB connected

- USB gadget disconnected when system boot kernel with USB connected. Commit
68b1c60f7f6c436340206679a18d61d9 induce the issue, call dr_discharge_line(1)
to ensure no abnormal usb wakeup interrupt happen after plug out the cable.
There are two cases cause dr_discharge_line(1) of fsl_otg_event() be called.
One case is switch the otg mode form Host mode to Device mode. Another case is
boot kernel with USB connected. The host_first_call is true when system boot
kernel with USB connected, otherwise it is false. So dr_discharge_line(true)
should not be called in fsl_otg_event() if host_first_call is true.

- USBOH3 clock is still on after plug out the cable when boot kernel with USB
connected, If the suspended bit is 0x1 and stopped is 0x0,the case is regarded
as suspend connected to usb charger. USB clock will be turn on, otherwise the
second suspend is processed without USB clock and it causes system hang. But
system boot kernel with cable connected, suspended is 0x1 and stopped is 0x0.
USB clock will be on by mistake. And stopped is cleared in dr_controller_run()
when system boot kernel with USB connected. We should check the suspended and
stopped bit before call dr_controller_run() to fix the issue.

Signed-off-by: make shi <b15407@freescale.com>
drivers/usb/gadget/arcotg_udc.c
drivers/usb/otg/fsl_otg.c