lkml.org 
[lkml]   [2015]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed
Date
This patch call runtiem PM function manually if the state is runtime resumed
before enter suspend.

This case has occurred when wake-up by the resume after entering to
suspend during the playback.
$ aplay -> runtime_resume() -> suspend() -> resume()

In this case, Can occurred an error when enter suspend.
--
[ 82.559234] PM: suspend of devices complete after 57.252 msecs
[ 82.567978] arizona spi1.0: Failed to read IRQ status: -108
[ 82.567989] arizona spi1.0: Failed to read main IRQ status: -108
[ 82.568027] arizona spi1.0: Failed to read IRQ status: -108
[ 82.568036] arizona spi1.0: Failed to read main IRQ status: -108
....
So, we should call runtime_suspend() manually when enter suspend
if the state is runtime resume.

Also should call runtime_resume() when wake-up by resume if the state
was runtime resume before entering suspend.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
drivers/mfd/arizona-core.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 908c69b..de55706 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -683,6 +683,10 @@ static int arizona_suspend(struct device *dev)
struct arizona *arizona = dev_get_drvdata(dev);

dev_dbg(arizona->dev, "Suspend, disabling IRQ\n");
+
+ if (!pm_runtime_status_suspended(dev))
+ arizona_runtime_suspend(dev);
+
disable_irq(arizona->irq);

return 0;
@@ -713,6 +717,10 @@ static int arizona_resume(struct device *dev)
struct arizona *arizona = dev_get_drvdata(dev);

dev_dbg(arizona->dev, "Late resume, reenabling IRQ\n");
+
+ if (!pm_runtime_status_suspended(dev))
+ arizona_runtime_resume(dev);
+
enable_irq(arizona->irq);

return 0;
--
2.0.0.390.gcb682f8


\
 
 \ /
  Last update: 2015-09-17 10:41    [W:0.056 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site