diff options
author | Felipe Balbi <balbi@ti.com> | 2015-02-26 14:02:35 -0600 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-03-10 15:33:29 -0500 |
commit | b4dc38fd45b63e3da2bc98db5d283a15a637a2fa (patch) | |
tree | fa97f486d5ff9bc79a370d81c3df78d2489c50b7 /drivers/usb/musb | |
parent | 011d0dd5400b84e593eecfc4a17fcfb6c0c5ac60 (diff) | |
download | linux-b4dc38fd45b63e3da2bc98db5d283a15a637a2fa.tar.bz2 |
usb: musb: core: simplify musb_recover_work()
we're not resetting musb at all, just restarting
the session. This means we don't need to touch PHYs
or VBUS or anything like that. Just make sure session
bit is reenabled after MUSB dropped it.
while at that, make sure to tell usbcore that we're
dropping the session and, thus, disconnecting the
device.
Tested-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 96d71fa2ae85..979bc2b0550f 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1835,7 +1835,8 @@ static void musb_irq_work(struct work_struct *data) static void musb_recover_work(struct work_struct *data) { struct musb *musb = container_of(data, struct musb, recover_work.work); - int status, ret; + int ret; + u8 devctl; ret = musb_platform_reset(musb); if (ret) { @@ -1843,23 +1844,25 @@ static void musb_recover_work(struct work_struct *data) return; } - usb_phy_vbus_off(musb->xceiv); - usleep_range(100, 200); + /* drop session bit */ + devctl = musb_readb(musb->mregs, MUSB_DEVCTL); + devctl &= ~MUSB_DEVCTL_SESSION; + musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); - usb_phy_vbus_on(musb->xceiv); - usleep_range(100, 200); + /* tell usbcore about it */ + musb_root_disconnect(musb); /* * When a babble condition occurs, the musb controller * removes the session bit and the endpoint config is lost. */ if (musb->dyn_fifo) - status = ep_config_from_table(musb); + ret = ep_config_from_table(musb); else - status = ep_config_from_hw(musb); + ret = ep_config_from_hw(musb); - /* start the session again */ - if (status == 0) + /* restart session */ + if (ret == 0) musb_start(musb); } |