CHROMIUM: ALSA: ASoC: soc-jack - export gpio detect.
authorDylan Reid <dgreid@chromium.org>
Tue, 25 Sep 2012 21:52:11 +0000 (14:52 -0700)
committerGerrit <chrome-bot@google.com>
Fri, 28 Sep 2012 19:02:37 +0000 (12:02 -0700)
Export the snd_soc_jack_gpio_detect function.  Allow it to be called to
poll a gpio jack during resume, checking for state changes that may have
been missed while sleeping.

BUG=chrome-os-partner:14417
TEST=Plug headphones, play audio, suspend, unplug, resume, check audio
comes from speakers.

Change-Id: I3c2abf1c69abca6178bde1391b323efa0a6c507d
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34047
Reviewed-by: Olof Johansson <olofj@chromium.org>
include/sound/soc.h
sound/soc/soc-jack.c

index 2ebf787..bbf9417 100644 (file)
@@ -361,6 +361,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
                        struct snd_soc_jack_gpio *gpios);
 void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
                        struct snd_soc_jack_gpio *gpios);
+void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio);
 #endif
 
 /* codec register bit access */
index ee4353f..71972f2 100644 (file)
@@ -236,8 +236,14 @@ void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
 EXPORT_SYMBOL_GPL(snd_soc_jack_notifier_unregister);
 
 #ifdef CONFIG_GPIOLIB
-/* gpio detect */
-static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
+/**
+ * snd_soc_jack_gpio_detect - Check the vlaue of the gpio and report jack state.
+ *
+ * @gpio: gpio pin to check.
+ *
+ *  This function will poll the state of the gpio and report on the jack.
+ */
+void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
 {
        struct snd_soc_jack *jack = gpio->jack;
        int enable;
@@ -257,6 +263,7 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
 
        snd_soc_jack_report(jack, report, gpio->report);
 }
+EXPORT_SYMBOL_GPL(snd_soc_jack_gpio_detect);
 
 /* irq handler for gpio pin */
 static irqreturn_t gpio_handler(int irq, void *data)