From: Mark Brown Date: Sun, 14 Nov 2010 19:25:09 +0000 (+0000) Subject: ASoC: Prevent system suspend while debouncing wakeup capable GPIO jacks X-Git-Tag: upstream/snapshot3+hdmi~7307^2~1226^2~291 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9a67059d43a8f12446356ed42d7694afc34bb92;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Acked-by: Liam Girdwood --- 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));