usb: musb: omap2+: save and restore OTG_INTERFSEL
authorHema HK <hemahk@ti.com>
Wed, 7 Sep 2011 16:19:24 +0000 (09:19 -0700)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Dec 2011 09:51:40 +0000 (11:51 +0200)
we need to save and restore OTG_INTERFSEL register
else we will be unable to function on resume after
OFF mode.

Reported-by: Devaraj Rangasamy <dev@ti.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_core.h
drivers/usb/musb/omap2430.c

index b3c065ab9dbc2f9aace5b36939390761fa0c5218..3259a6bbaba39993cf8503ecff5e0738b83cf71c 100644 (file)
@@ -311,6 +311,7 @@ struct musb_context_registers {
        u8 index, testmode;
 
        u8 devctl, busctl, misc;
+       u32 otg_interfsel;
 
        struct musb_csr_regs index_regs[MUSB_C_NUM_EPS];
 };
index ba85f273e4874f3db7e69d390a590b833c894a31..78eb13a3379609308513cb869fdfbc1f8c4cef08 100644 (file)
@@ -491,6 +491,9 @@ static int omap2430_runtime_suspend(struct device *dev)
        struct omap2430_glue            *glue = dev_get_drvdata(dev);
        struct musb                     *musb = glue_to_musb(glue);
 
+       musb->context.otg_interfsel = musb_readl(musb->mregs,
+                                               OTG_INTERFSEL);
+
        omap2430_low_level_exit(musb);
        otg_set_suspend(musb->xceiv, 1);
 
@@ -503,6 +506,9 @@ static int omap2430_runtime_resume(struct device *dev)
        struct musb                     *musb = glue_to_musb(glue);
 
        omap2430_low_level_init(musb);
+       musb_writel(musb->mregs, OTG_INTERFSEL,
+                                       musb->context.otg_interfsel);
+
        otg_set_suspend(musb->xceiv, 0);
 
        return 0;