Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c871a053 authored by Joonyoung Shim's avatar Joonyoung Shim Committed by Mark Brown
Browse files

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: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f7732053
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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

+3 −0
Original line number Diff line number Diff line
@@ -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);
}