diff options
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | 2011-12-13 13:50:58 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-12-13 13:50:58 -0500 |
commit | 8f718d2414c2c13f7c886df1d1802ad0d32faaca (patch) | |
tree | fa9269ec9553e6cad9caa01a343a0a8886e66506 /arch/arm/mach-omap2/omap_phy_internal.c | |
parent | cada691f8675c36f738d41741a6ec5d966f39a10 (diff) |
ARM: OMAP: musb: Add ti81xx phy power function
Adding ti81xx_musb_phy_power() which will be used by musb driver through
its function pointer in board_data.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_phy_internal.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_phy_internal.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c index 58775e3c8476..4c90477e6f82 100644 --- a/arch/arm/mach-omap2/omap_phy_internal.c +++ b/arch/arm/mach-omap2/omap_phy_internal.c | |||
@@ -260,3 +260,38 @@ void am35x_set_mode(u8 musb_mode) | |||
260 | 260 | ||
261 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | 261 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); |
262 | } | 262 | } |
263 | |||
264 | void ti81xx_musb_phy_power(u8 on) | ||
265 | { | ||
266 | void __iomem *scm_base = NULL; | ||
267 | u32 usbphycfg; | ||
268 | |||
269 | scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K); | ||
270 | if (!scm_base) { | ||
271 | pr_err("system control module ioremap failed\n"); | ||
272 | return; | ||
273 | } | ||
274 | |||
275 | usbphycfg = __raw_readl(scm_base + USBCTRL0); | ||
276 | |||
277 | if (on) { | ||
278 | if (cpu_is_ti816x()) { | ||
279 | usbphycfg |= TI816X_USBPHY0_NORMAL_MODE; | ||
280 | usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC; | ||
281 | } else if (cpu_is_ti814x()) { | ||
282 | usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN | ||
283 | | USBPHY_DPINPUT | USBPHY_DMINPUT); | ||
284 | usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN | ||
285 | | USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL); | ||
286 | } | ||
287 | } else { | ||
288 | if (cpu_is_ti816x()) | ||
289 | usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE; | ||
290 | else if (cpu_is_ti814x()) | ||
291 | usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN; | ||
292 | |||
293 | } | ||
294 | __raw_writel(usbphycfg, scm_base + USBCTRL0); | ||
295 | |||
296 | iounmap(scm_base); | ||
297 | } | ||