alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Use pm_wakeup_event() in WM8962 jack detection
@ 2010-11-03 18:50 Mark Brown
  2010-11-03 19:25 ` Liam Girdwood
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2010-11-03 18:50 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown

Ensure that the system does not suspend while we process a WM8962 jack
event by using pm_wakeup_event() to block the suspend while we're waiting
for the jack to settle. Use a slightly longer timeout than the jack waits
to allow for other stuff to take over and delays in scheduling.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm8962.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 894d0cd..2eaf9bb 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3353,6 +3353,8 @@ static irqreturn_t wm8962_irq(int irq, void *data)
 	if (active & (WM8962_MICSCD_EINT | WM8962_MICD_EINT)) {
 		dev_dbg(codec->dev, "Microphone event detected\n");
 
+		pm_wakeup_event(codec->dev, 300);
+
 		schedule_delayed_work(&wm8962->mic_work,
 				      msecs_to_jiffies(250));
 	}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: Use pm_wakeup_event() in WM8962 jack detection
  2010-11-03 18:50 [PATCH] ASoC: Use pm_wakeup_event() in WM8962 jack detection Mark Brown
@ 2010-11-03 19:25 ` Liam Girdwood
  0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2010-11-03 19:25 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, patches

On Wed, 2010-11-03 at 14:50 -0400, Mark Brown wrote:
> Ensure that the system does not suspend while we process a WM8962 jack
> event by using pm_wakeup_event() to block the suspend while we're waiting
> for the jack to settle. Use a slightly longer timeout than the jack waits
> to allow for other stuff to take over and delays in scheduling.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-03 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-03 18:50 [PATCH] ASoC: Use pm_wakeup_event() in WM8962 jack detection Mark Brown
2010-11-03 19:25 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).