diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-18 01:35:55 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-18 18:14:14 +0100 |
commit | 7887ab3a274dc5f1d1d94ca0cd41ae495d01f94f (patch) | |
tree | 9182cd4d0c2c857688520a50f733d1c9f690039c /sound/soc/soc-jack.c | |
parent | ASoC: Log wm_hubs DC servo operation code when reporting a timeout (diff) | |
download | linux-7887ab3a274dc5f1d1d94ca0cd41ae495d01f94f.tar.xz linux-7887ab3a274dc5f1d1d94ca0cd41ae495d01f94f.zip |
ASoC: Allow GPIO jack detection to be configured as a wake source
Some systems wish to use jacks as wake sources. Provide a wake flag in the
GPIO configuration which causes the driver to enable the IRQ as a wake
source.
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 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 4579ee090bbf..1382251ed2a2 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -330,6 +330,14 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, if (ret) goto err; + if (gpios[i].wake) { + ret = set_irq_wake(gpio_to_irq(gpios[i].gpio), 1); + if (ret != 0) + printk(KERN_ERR + "Failed to mark GPIO %d as wake source: %d\n", + gpios[i].gpio, ret); + } + #ifdef CONFIG_GPIO_SYSFS /* Expose GPIO value over sysfs for diagnostic purposes */ gpio_export(gpios[i].gpio, false); |