Skip to content

Commit

Permalink
usb: musb: unconditionally save and restore the context on suspend
Browse files Browse the repository at this point in the history
It appears not all platforms featuring a musb core need to save the musb
core registers at suspend time and restore them on resume.

The dsps platform does, however, and because it shouldn't cause any
trouble on other platforms, do it unconditionally for all of them.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Daniel Mack authored and Felipe Balbi committed Nov 26, 2013
1 parent e0a6104 commit c338412
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2224,16 +2224,28 @@ static int musb_suspend(struct device *dev)
*/
}

musb_save_context(musb);

spin_unlock_irqrestore(&musb->lock, flags);
return 0;
}

static int musb_resume_noirq(struct device *dev)
{
/* for static cmos like DaVinci, register values were preserved
struct musb *musb = dev_to_musb(dev);

/*
* For static cmos like DaVinci, register values were preserved
* unless for some reason the whole soc powered down or the USB
* module got reset through the PSC (vs just being disabled).
*
* For the DSPS glue layer though, a full register restore has to
* be done. As it shouldn't harm other platforms, we do it
* unconditionally.
*/

musb_restore_context(musb);

return 0;
}

Expand Down

0 comments on commit c338412

Please sign in to comment.