Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155372
b: refs/heads/master
c: d163ef2
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jul 12, 2009
1 parent 1719d3d commit 0593193
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6bc2146e2b01654534a1cae127ef96bf4b5f3d53
refs/heads/master: d163ef248385fc434e44b04a5151ae5d6a6c2d16
25 changes: 25 additions & 0 deletions trunk/drivers/usb/musb/davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <mach/hardware.h>
#include <mach/memory.h>
#include <mach/gpio.h>
#include <mach/cputype.h>

#include <asm/mach-types.h>

Expand Down Expand Up @@ -411,6 +412,21 @@ int __init musb_platform_init(struct musb *musb)
__raw_writel(phy_ctrl, USB_PHY_CTRL);
}

/* On dm355, the default-A state machine needs DRVVBUS control.
* If we won't be a host, there's no need to turn it on.
*/
if (cpu_is_davinci_dm355()) {
u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);

if (is_host_enabled(musb)) {
deepsleep &= ~DRVVBUS_OVERRIDE;
} else {
deepsleep &= ~DRVVBUS_FORCE;
deepsleep |= DRVVBUS_OVERRIDE;
}
__raw_writel(deepsleep, DM355_DEEPSLEEP);
}

/* reset the controller */
musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1);

Expand All @@ -437,6 +453,15 @@ int musb_platform_exit(struct musb *musb)
if (is_host_enabled(musb))
del_timer_sync(&otg_workaround);

/* force VBUS off */
if (cpu_is_davinci_dm355()) {
u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);

deepsleep &= ~DRVVBUS_FORCE;
deepsleep |= DRVVBUS_OVERRIDE;
__raw_writel(deepsleep, DM355_DEEPSLEEP);
}

davinci_source_power(musb, 0 /*off*/, 1);

/* delay, to avoid problems with module reload */
Expand Down

0 comments on commit 0593193

Please sign in to comment.