diff options
| author | Felipe Balbi <balbi@ti.com> | 2015-02-26 15:00:52 -0500 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2015-03-10 16:33:28 -0400 |
| commit | 011d0dd5400b84e593eecfc4a17fcfb6c0c5ac60 (patch) | |
| tree | 3df67d75726e3ff53e182cab8d065bb2d09c23aa /drivers/usb/musb | |
| parent | d5fa3e9f7398adf337f03fa3257d5e9b214078ee (diff) | |
usb: musb: dsps: do not reset musb on babble
All we have to do is, really, drop session bit
and let the session restart.
Big thanks goes to Bin Liu <b-liu@ti.com> for
inspiring this work.
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_dsps.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 85ebfa2c3858..a159de1225f3 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c | |||
| @@ -604,31 +604,12 @@ static int dsps_musb_reset(struct musb *musb) | |||
| 604 | { | 604 | { |
| 605 | struct device *dev = musb->controller; | 605 | struct device *dev = musb->controller; |
| 606 | struct dsps_glue *glue = dev_get_drvdata(dev->parent); | 606 | struct dsps_glue *glue = dev_get_drvdata(dev->parent); |
| 607 | const struct dsps_musb_wrapper *wrp = glue->wrp; | 607 | int session_restart = 0; |
| 608 | int session_restart = 0, error; | ||
| 609 | 608 | ||
| 610 | if (glue->sw_babble_enabled) | 609 | if (glue->sw_babble_enabled) |
| 611 | session_restart = dsps_sw_babble_control(musb); | 610 | session_restart = dsps_sw_babble_control(musb); |
| 612 | /* | 611 | else |
| 613 | * In case of new silicon version babble condition can be recovered | ||
| 614 | * without resetting the MUSB. But for older silicon versions, MUSB | ||
| 615 | * reset is needed | ||
| 616 | */ | ||
| 617 | if (session_restart || !glue->sw_babble_enabled) { | ||
| 618 | dev_info(musb->controller, "Restarting MUSB to recover from Babble\n"); | ||
| 619 | dsps_writel(musb->ctrl_base, wrp->control, (1 << wrp->reset)); | ||
| 620 | usleep_range(100, 200); | ||
| 621 | usb_phy_shutdown(musb->xceiv); | ||
| 622 | error = phy_power_off(musb->phy); | ||
| 623 | if (error) | ||
| 624 | dev_err(dev, "phy shutdown failed: %i\n", error); | ||
| 625 | usleep_range(100, 200); | ||
| 626 | usb_phy_init(musb->xceiv); | ||
| 627 | error = phy_power_on(musb->phy); | ||
| 628 | if (error) | ||
| 629 | dev_err(dev, "phy powerup failed: %i\n", error); | ||
| 630 | session_restart = 1; | 612 | session_restart = 1; |
| 631 | } | ||
| 632 | 613 | ||
| 633 | return session_restart ? 0 : -EPIPE; | 614 | return session_restart ? 0 : -EPIPE; |
| 634 | } | 615 | } |
