diff options
author | Andy Green <andy.green@linaro.org> | 2011-12-16 13:11:51 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-01-09 08:39:38 +0800 |
commit | 781f6ef8e80ce348fb69f157e106b5369c700dad (patch) | |
tree | e1c5be32a59dccd90d10e97764ca6794984a416b | |
parent | 29f81ff79796c9af413a6ea84727498f4d79b141 (diff) |
musb suspend runtime pm coverage
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r-- | drivers/usb/musb/musb_core.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index d914a1d8cf0..4e3a7f753af 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2292,6 +2292,8 @@ static int musb_suspend(struct device *dev) struct musb *musb = dev_to_musb(dev); unsigned long flags; + pm_runtime_get_sync(musb->controller); + spin_lock_irqsave(&musb->lock, flags); if (is_peripheral_active(musb)) { @@ -2305,15 +2307,26 @@ static int musb_suspend(struct device *dev) } spin_unlock_irqrestore(&musb->lock, flags); + pm_runtime_put(musb->controller); + return 0; } static int musb_resume_noirq(struct device *dev) { + struct musb *musb = dev_to_musb(dev); + + pm_runtime_get_sync(musb->controller); + + musb_restore_context(musb); + /* 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). */ + + pm_runtime_put(musb->controller); + return 0; } |