aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-07-01 06:32:43 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-07-12 18:16:37 -0400
commitd163ef248385fc434e44b04a5151ae5d6a6c2d16 (patch)
tree3ab91dade693c919332b38cfa0ad52aedbccb90a /drivers/usb
parent6bc2146e2b01654534a1cae127ef96bf4b5f3d53 (diff)
USB: musb: davinci dm355 updates (remainder)
Finish merging updates for DM355 chips into musb/davinci.c now that its support is in mainline: kick in new DRVVBUS controls. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-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 */