usb: musb: Add context save and restore support

Adding support for MUSB register save and restore during system
suspend and resume.

Changes:
        - Added musb_save/restore_context() functions
        - Added platform specific musb_platform_save/restore_context()
          to handle platform specific jobs.
        - Maintaining BlackFin compatibility by adding read/write
          functions for registers which are not available in BlackFin

Tested system suspend and resume on OMAP3EVM board.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Ajay Kumar Gupta
2010-01-21 15:33:52 +02:00
committed by Greg Kroah-Hartman
parent 8af6096caf
commit 4f712e010b
4 changed files with 291 additions and 0 deletions

View File

@@ -255,6 +255,22 @@ int __init musb_platform_init(struct musb *musb)
return 0;
}
#ifdef CONFIG_PM
void musb_platform_save_context(struct musb_context_registers
*musb_context)
{
musb_context->otg_sysconfig = omap_readl(OTG_SYSCONFIG);
musb_context->otg_forcestandby = omap_readl(OTG_FORCESTDBY);
}
void musb_platform_restore_context(struct musb_context_registers
*musb_context)
{
omap_writel(musb_context->otg_sysconfig, OTG_SYSCONFIG);
omap_writel(musb_context->otg_forcestandby, OTG_FORCESTDBY);
}
#endif
int musb_platform_suspend(struct musb *musb)
{
u32 l;