[alsa-devel] [PATCH] ASoC: add data field into snd_soc_jack_gpio

xiangxiao xiaoxiang at xiaomi.com
Sun Feb 23 07:40:44 CET 2014


so callback could get the context data as needed

Change-Id: I5542613ccf9881deb672e71d0f0c4f603ad761fd
Signed-off-by: xiangxiao <xiaoxiang at xiaomi.com>
---
 include/sound/soc.h  | 3 ++-
 sound/soc/soc-jack.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 21038e0..a789a29 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -613,7 +613,8 @@ struct snd_soc_jack_gpio {
 	struct snd_soc_jack *jack;
 	struct delayed_work work;
 
-	int (*jack_status_check)(void);
+	void *data;
+	int (*jack_status_check)(void *data);
 };
 
 struct snd_soc_jack {
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index b12fce6..b903f82 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -250,7 +250,7 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
 		report = 0;
 
 	if (gpio->jack_status_check)
-		report = gpio->jack_status_check();
+		report = gpio->jack_status_check(gpio->data);
 
 	snd_soc_jack_report(jack, report, gpio->report);
 }
-- 
1.8.1.2



More information about the Alsa-devel mailing list