* [PATCH] ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks
@ 2010-11-14 19:26 Mark Brown
2010-11-15 11:09 ` Liam Girdwood
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2010-11-14 19:26 UTC (permalink / raw)
To: Liam Girdwoo; +Cc: alsa-devel, Mark Brown
If the device associated with a GPIO jack is wakeup capable then disable
suspend while we're debouncing the jack so that we skip suspends that race
with the jack.
Note that currently the GPIO based jack has a CODEC associated with it
which we're using right now. These jacks should be reparented against the
card itself and this code adjusted.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/soc-jack.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 4d95abb..619061d 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -209,6 +209,10 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
static irqreturn_t gpio_handler(int irq, void *data)
{
struct snd_soc_jack_gpio *gpio = data;
+ struct device *dev = gpio->jack->codec->card->dev;
+
+ if (device_may_wakeup(dev))
+ pm_wakeup_event(dev, gpio->debounce_time + 50);
schedule_delayed_work(&gpio->work,
msecs_to_jiffies(gpio->debounce_time));
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks
2010-11-14 19:26 [PATCH] ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks Mark Brown
@ 2010-11-15 11:09 ` Liam Girdwood
0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2010-11-15 11:09 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel
On Sun, 2010-11-14 at 19:26 +0000, Mark Brown wrote:
> If the device associated with a GPIO jack is wakeup capable then disable
> suspend while we're debouncing the jack so that we skip suspends that race
> with the jack.
>
> Note that currently the GPIO based jack has a CODEC associated with it
> which we're using right now. These jacks should be reparented against the
> card itself and this code adjusted.
>
> 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-15 11:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-14 19:26 [PATCH] ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks Mark Brown
2010-11-15 11:09 ` 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).