diff options
author | David S. Miller <davem@davemloft.net> | 2010-03-15 23:23:54 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-15 23:23:54 (GMT) |
commit | 4961e02f1999e1c3468c09b2669c94d7c3ae82a8 (patch) | |
tree | 44c15abb09d7ba5e17a9aba95ee246648b1c1a8a /drivers/usb/musb/omap2430.c | |
parent | d14a0ebda7d3daede1a99c01527affb9ceaa4c22 (diff) | |
parent | a3d3203e4bb40f253b1541e310dc0f9305be7c84 (diff) | |
download | linux-fsl-qoriq-4961e02f1999e1c3468c09b2669c94d7c3ae82a8.tar.xz |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'drivers/usb/musb/omap2430.c')
-rw-r--r-- | drivers/usb/musb/omap2430.c | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 83beeac..3fe1686 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -220,7 +220,7 @@ int __init musb_platform_init(struct musb *musb) musb_platform_resume(musb); - l = omap_readl(OTG_SYSCONFIG); + l = musb_readl(musb->mregs, OTG_SYSCONFIG); l &= ~ENABLEWAKEUP; /* disable wakeup */ l &= ~NOSTDBY; /* remove possible nostdby */ l |= SMARTSTDBY; /* enable smart standby */ @@ -233,17 +233,19 @@ int __init musb_platform_init(struct musb *musb) */ if (!cpu_is_omap3430()) l |= AUTOIDLE; /* enable auto idle */ - omap_writel(l, OTG_SYSCONFIG); + musb_writel(musb->mregs, OTG_SYSCONFIG, l); - l = omap_readl(OTG_INTERFSEL); + l = musb_readl(musb->mregs, OTG_INTERFSEL); l |= ULPI_12PIN; - omap_writel(l, OTG_INTERFSEL); + musb_writel(musb->mregs, OTG_INTERFSEL, l); pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, " "sysstatus 0x%x, intrfsel 0x%x, simenable 0x%x\n", - omap_readl(OTG_REVISION), omap_readl(OTG_SYSCONFIG), - omap_readl(OTG_SYSSTATUS), omap_readl(OTG_INTERFSEL), - omap_readl(OTG_SIMENABLE)); + musb_readl(musb->mregs, OTG_REVISION), + musb_readl(musb->mregs, OTG_SYSCONFIG), + musb_readl(musb->mregs, OTG_SYSSTATUS), + musb_readl(musb->mregs, OTG_INTERFSEL), + musb_readl(musb->mregs, OTG_SIMENABLE)); omap_vbus_power(musb, musb->board_mode == MUSB_HOST, 1); @@ -255,6 +257,22 @@ int __init musb_platform_init(struct musb *musb) return 0; } +#ifdef CONFIG_PM +void musb_platform_save_context(struct musb *musb, + struct musb_context_registers *musb_context) +{ + musb_context->otg_sysconfig = musb_readl(musb->mregs, OTG_SYSCONFIG); + musb_context->otg_forcestandby = musb_readl(musb->mregs, OTG_FORCESTDBY); +} + +void musb_platform_restore_context(struct musb *musb, + struct musb_context_registers *musb_context) +{ + musb_writel(musb->mregs, OTG_SYSCONFIG, musb_context->otg_sysconfig); + musb_writel(musb->mregs, OTG_FORCESTDBY, musb_context->otg_forcestandby); +} +#endif + int musb_platform_suspend(struct musb *musb) { u32 l; @@ -263,13 +281,13 @@ int musb_platform_suspend(struct musb *musb) return 0; /* in any role */ - l = omap_readl(OTG_FORCESTDBY); + l = musb_readl(musb->mregs, OTG_FORCESTDBY); l |= ENABLEFORCE; /* enable MSTANDBY */ - omap_writel(l, OTG_FORCESTDBY); + musb_writel(musb->mregs, OTG_FORCESTDBY, l); - l = omap_readl(OTG_SYSCONFIG); + l = musb_readl(musb->mregs, OTG_SYSCONFIG); l |= ENABLEWAKEUP; /* enable wakeup */ - omap_writel(l, OTG_SYSCONFIG); + musb_writel(musb->mregs, OTG_SYSCONFIG, l); otg_set_suspend(musb->xceiv, 1); @@ -295,13 +313,13 @@ static int musb_platform_resume(struct musb *musb) else clk_enable(musb->clock); - l = omap_readl(OTG_SYSCONFIG); + l = musb_readl(musb->mregs, OTG_SYSCONFIG); l &= ~ENABLEWAKEUP; /* disable wakeup */ - omap_writel(l, OTG_SYSCONFIG); + musb_writel(musb->mregs, OTG_SYSCONFIG, l); - l = omap_readl(OTG_FORCESTDBY); + l = musb_readl(musb->mregs, OTG_FORCESTDBY); l &= ~ENABLEFORCE; /* disable MSTANDBY */ - omap_writel(l, OTG_FORCESTDBY); + musb_writel(musb->mregs, OTG_FORCESTDBY, l); return 0; } |