From david-b@pacbell.net Thu Jul 2 15:46:04 2009 From: David Brownell Date: Wed, 1 Jul 2009 03:32:43 -0700 Subject: USB: musb: davinci dm355 updates (remainder) To: Greg KH Cc: linux-usb@vger.kernel.org, Kevin Hilman Message-ID: <200907010332.43849.david-b@pacbell.net> Content-Disposition: inline From: David Brownell 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 Signed-off-by: Kevin Hilman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/davinci.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -411,6 +412,21 @@ int __init musb_platform_init(struct mus __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); @@ -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 */