From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwoo <lrg@slimlogic.co.uk>
Cc: alsa-devel@alsa-project.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH] ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks
Date: Sun, 14 Nov 2010 19:26:13 +0000 [thread overview]
Message-ID: <1289762773-19239-1-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
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
next reply other threads:[~2010-11-14 19:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-14 19:26 Mark Brown [this message]
2010-11-15 11:09 ` [PATCH] ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks Liam Girdwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1289762773-19239-1-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=lrg@slimlogic.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).