ASoC: Add jack_status_check callback function for GPIO jacks
authorJoonyoung Shim <jy0922.shim@samsung.com>
Thu, 12 Nov 2009 08:14:04 +0000 (17:14 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 12 Nov 2009 16:45:53 +0000 (16:45 +0000)
The jack_status_check callback function is the interface to check the
status of the jack. Some target provides the method to distinguish what
is the jack inserted - headphone jack, microphone jack, tvout jack, etc,
so we can implement it using the jack_status_check function.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h
sound/soc/soc-jack.c

index 310a21949a3ede902c9402428f0707097bc14d13..13b117aac5d9bdb2ad328c3df75af4dba1c79201 100644 (file)
@@ -332,6 +332,8 @@ struct snd_soc_jack_gpio {
        int debounce_time;
        struct snd_soc_jack *jack;
        struct work_struct work;
+
+       int (*jack_status_check)(void);
 };
 #endif
 
index 12124149601e627f721a86ec5401935bac1b1eff..3c07a94c2e300cd0f75a60617411894971f81d7d 100644 (file)
@@ -163,6 +163,9 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
        else
                report = 0;
 
+       if (gpio->jack_status_check)
+               report = gpio->jack_status_check();
+
        snd_soc_jack_report(jack, report, gpio->report);
 }