From: Joonyoung Shim Date: Thu, 12 Nov 2009 08:14:04 +0000 (+0900) Subject: ASoC: Add jack_status_check callback function for GPIO jacks X-Git-Tag: v2.6.33-rc3~4^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c871a05315d1a76034ea06feeda92081e1d608bf;p=platform%2Fkernel%2Flinux-3.10.git ASoC: Add jack_status_check callback function for GPIO jacks 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 Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/include/sound/soc.h b/include/sound/soc.h index 310a219..13b117a 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -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 diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 1212414..3c07a94 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -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); }