Commit e25bec16 authored by Hema HK's avatar Hema HK Committed by Felipe Balbi

usb: musb: omap2+: save and restore OTG_INTERFSEL

we need to save and restore OTG_INTERFSEL register
else we will be unable to function on resume after
OFF mode.
Reported-by: default avatarDevaraj Rangasamy <dev@ti.com>
Signed-off-by: default avatarHema HK <hemahk@ti.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarVikram Pandita <vikram.pandita@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent ea737554
...@@ -311,6 +311,7 @@ struct musb_context_registers { ...@@ -311,6 +311,7 @@ struct musb_context_registers {
u8 index, testmode; u8 index, testmode;
u8 devctl, busctl, misc; u8 devctl, busctl, misc;
u32 otg_interfsel;
struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; struct musb_csr_regs index_regs[MUSB_C_NUM_EPS];
}; };
......
...@@ -491,6 +491,9 @@ static int omap2430_runtime_suspend(struct device *dev) ...@@ -491,6 +491,9 @@ static int omap2430_runtime_suspend(struct device *dev)
struct omap2430_glue *glue = dev_get_drvdata(dev); struct omap2430_glue *glue = dev_get_drvdata(dev);
struct musb *musb = glue_to_musb(glue); struct musb *musb = glue_to_musb(glue);
musb->context.otg_interfsel = musb_readl(musb->mregs,
OTG_INTERFSEL);
omap2430_low_level_exit(musb); omap2430_low_level_exit(musb);
otg_set_suspend(musb->xceiv, 1); otg_set_suspend(musb->xceiv, 1);
...@@ -503,6 +506,9 @@ static int omap2430_runtime_resume(struct device *dev) ...@@ -503,6 +506,9 @@ static int omap2430_runtime_resume(struct device *dev)
struct musb *musb = glue_to_musb(glue); struct musb *musb = glue_to_musb(glue);
omap2430_low_level_init(musb); omap2430_low_level_init(musb);
musb_writel(musb->mregs, OTG_INTERFSEL,
musb->context.otg_interfsel);
otg_set_suspend(musb->xceiv, 0); otg_set_suspend(musb->xceiv, 0);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment