[alsa-devel] [PATCH] ASoC: pass snd_soc_jack_gpio to jack_status_check callback
so the implementation could get the context data
Change-Id: I5542613ccf9881deb672e71d0f0c4f603ad761fd Signed-off-by: xiangxiao xiaoxiang@xiaomi.com --- include/sound/soc.h | 2 +- sound/soc/soc-jack.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 21038e0..e287462 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -613,7 +613,7 @@ struct snd_soc_jack_gpio { struct snd_soc_jack *jack; struct delayed_work work;
- int (*jack_status_check)(void); + int (*jack_status_check)(struct snd_soc_jack_gpio *gpio); };
struct snd_soc_jack { diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index b12fce6..6028af5 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);
snd_soc_jack_report(jack, report, gpio->report); }
On Sun, Feb 16, 2014 at 01:36:12PM +0800, xiangxiao wrote:
so the implementation could get the context data
Change-Id: I5542613ccf9881deb672e71d0f0c4f603ad761fd
This shouldn't be on upstream patches.
Signed-off-by: xiangxiao xiaoxiang@xiaomi.com
- int (*jack_status_check)(void);
- int (*jack_status_check)(struct snd_soc_jack_gpio *gpio);
Why is the callback using details of the implementation of snd_soc_jack_gpio? Perhaps there's a good reason, I'm not sure and you've not included any implementation. I'd have expected to see the jack able to provide its own context here?
participants (2)
-
Mark Brown
-
xiangxiao