summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2011-10-25 10:52:04 +0800
committerAndy Green <andy.green@linaro.org>2011-10-25 10:52:04 +0800
commit285574ae6a71b786a19059c5fb905ae5c06ff1ef (patch)
treefbc95d13b4220acf409ee31fcb425fa3a22d5a59
parentd23543e16738fe7746e25405d5204689076115fa (diff)
musb suspend runtime pm coverage
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r--drivers/usb/musb/musb_core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 20a28731c33..2d3f1edf37d 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2290,6 +2290,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,6 +2307,8 @@ static int musb_suspend(struct device *dev)
musb_save_context(musb);
spin_unlock_irqrestore(&musb->lock, flags);
+ pm_runtime_put(musb->controller);
+
return 0;
}
@@ -2312,12 +2316,17 @@ 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;
}