diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-14 14:25:09 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-15 06:44:43 -0500 |
commit | f9a67059d43a8f12446356ed42d7694afc34bb92 (patch) | |
tree | c986b44b9b23214122f028f0cda4fafcff80391f /sound/soc/soc-jack.c | |
parent | cb2b3cf1fedd31916b7c64d61e2d20d23bd3681a (diff) |
ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks
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>
Diffstat (limited to 'sound/soc/soc-jack.c')
-rw-r--r-- | 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 4d95abb40288..619061d689a3 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) | |||
209 | static irqreturn_t gpio_handler(int irq, void *data) | 209 | static irqreturn_t gpio_handler(int irq, void *data) |
210 | { | 210 | { |
211 | struct snd_soc_jack_gpio *gpio = data; | 211 | struct snd_soc_jack_gpio *gpio = data; |
212 | struct device *dev = gpio->jack->codec->card->dev; | ||
213 | |||
214 | if (device_may_wakeup(dev)) | ||
215 | pm_wakeup_event(dev, gpio->debounce_time + 50); | ||
212 | 216 | ||
213 | schedule_delayed_work(&gpio->work, | 217 | schedule_delayed_work(&gpio->work, |
214 | msecs_to_jiffies(gpio->debounce_time)); | 218 | msecs_to_jiffies(gpio->debounce_time)); |