aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/omap2430.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/omap2430.c')
-rw-r--r--drivers/usb/musb/omap2430.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index fa3154b03044..2659667a1994 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -258,21 +258,17 @@ static int omap2430_musb_init(struct musb *musb)
258 return 0; 258 return 0;
259} 259}
260 260
261#ifdef CONFIG_PM 261static void omap2430_save_context(struct musb *musb)
262void musb_platform_save_context(struct musb *musb,
263 struct musb_context_registers *musb_context)
264{ 262{
265 musb_context->otg_sysconfig = musb_readl(musb->mregs, OTG_SYSCONFIG); 263 musb->context.otg_sysconfig = musb_readl(musb->mregs, OTG_SYSCONFIG);
266 musb_context->otg_forcestandby = musb_readl(musb->mregs, OTG_FORCESTDBY); 264 musb->context.otg_forcestandby = musb_readl(musb->mregs, OTG_FORCESTDBY);
267} 265}
268 266
269void musb_platform_restore_context(struct musb *musb, 267static void omap2430_restore_context(struct musb *musb)
270 struct musb_context_registers *musb_context)
271{ 268{
272 musb_writel(musb->mregs, OTG_SYSCONFIG, musb_context->otg_sysconfig); 269 musb_writel(musb->mregs, OTG_SYSCONFIG, musb->context.otg_sysconfig);
273 musb_writel(musb->mregs, OTG_FORCESTDBY, musb_context->otg_forcestandby); 270 musb_writel(musb->mregs, OTG_FORCESTDBY, musb->context.otg_forcestandby);
274} 271}
275#endif
276 272
277static int omap2430_musb_suspend(struct musb *musb) 273static int omap2430_musb_suspend(struct musb *musb)
278{ 274{
@@ -287,6 +283,8 @@ static int omap2430_musb_suspend(struct musb *musb)
287 l |= ENABLEWAKEUP; /* enable wakeup */ 283 l |= ENABLEWAKEUP; /* enable wakeup */
288 musb_writel(musb->mregs, OTG_SYSCONFIG, l); 284 musb_writel(musb->mregs, OTG_SYSCONFIG, l);
289 285
286 omap2430_save_context(musb);
287
290 otg_set_suspend(musb->xceiv, 1); 288 otg_set_suspend(musb->xceiv, 1);
291 289
292 return 0; 290 return 0;
@@ -298,6 +296,8 @@ static int omap2430_musb_resume(struct musb *musb)
298 296
299 otg_set_suspend(musb->xceiv, 0); 297 otg_set_suspend(musb->xceiv, 0);
300 298
299 omap2430_restore_context(musb);
300
301 l = musb_readl(musb->mregs, OTG_SYSCONFIG); 301 l = musb_readl(musb->mregs, OTG_SYSCONFIG);
302 l &= ~ENABLEWAKEUP; /* disable wakeup */ 302 l &= ~ENABLEWAKEUP; /* disable wakeup */
303 musb_writel(musb->mregs, OTG_SYSCONFIG, l); 303 musb_writel(musb->mregs, OTG_SYSCONFIG, l);