aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/davinci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/davinci.c')
-rw-r--r--drivers/usb/musb/davinci.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 180d7daa4099..658ae4e83f6a 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -35,6 +35,7 @@
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/memory.h> 36#include <mach/memory.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/cputype.h>
38 39
39#include <asm/mach-types.h> 40#include <asm/mach-types.h>
40 41
@@ -411,6 +412,21 @@ int __init musb_platform_init(struct musb *musb)
411 __raw_writel(phy_ctrl, USB_PHY_CTRL); 412 __raw_writel(phy_ctrl, USB_PHY_CTRL);
412 } 413 }
413 414
415 /* On dm355, the default-A state machine needs DRVVBUS control.
416 * If we won't be a host, there's no need to turn it on.
417 */
418 if (cpu_is_davinci_dm355()) {
419 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
420
421 if (is_host_enabled(musb)) {
422 deepsleep &= ~DRVVBUS_OVERRIDE;
423 } else {
424 deepsleep &= ~DRVVBUS_FORCE;
425 deepsleep |= DRVVBUS_OVERRIDE;
426 }
427 __raw_writel(deepsleep, DM355_DEEPSLEEP);
428 }
429
414 /* reset the controller */ 430 /* reset the controller */
415 musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1); 431 musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1);
416 432
@@ -437,6 +453,15 @@ int musb_platform_exit(struct musb *musb)
437 if (is_host_enabled(musb)) 453 if (is_host_enabled(musb))
438 del_timer_sync(&otg_workaround); 454 del_timer_sync(&otg_workaround);
439 455
456 /* force VBUS off */
457 if (cpu_is_davinci_dm355()) {
458 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
459
460 deepsleep &= ~DRVVBUS_FORCE;
461 deepsleep |= DRVVBUS_OVERRIDE;
462 __raw_writel(deepsleep, DM355_DEEPSLEEP);
463 }
464
440 davinci_source_power(musb, 0 /*off*/, 1); 465 davinci_source_power(musb, 0 /*off*/, 1);
441 466
442 /* delay, to avoid problems with module reload */ 467 /* delay, to avoid problems with module reload */