[alsa-devel] [PATCH 6/8] Audio driver of Always Innovating OMAP3-based Touch Book

Mark Brown broonie at opensource.wolfsonmicro.com
Mon Nov 23 16:35:04 CET 2009


On Thu, Nov 19, 2009 at 09:18:09AM -0800, Gregoire Gentil wrote:

> Signed-off-by: Gregoire Gentil <gregoire at gentil.com>

Please remember to CC the maintainers for the subsystem you're
submitting to on patches.

> +static irqreturn_t touchbook_headphone_event(int irq, void *snd)
> +{
> +	int status = gpio_get_value(TB_HEADPHONE_GPIO);
> +	struct snd_soc_device *socdev = platform_get_drvdata(
> +						omap3touchbook_snd_device);
> +	struct snd_soc_codec *codec = socdev->card->codec;
> +
> +	if (status) {
> +		snd_soc_dapm_disable_pin(codec, "HFL");
> +		snd_soc_dapm_disable_pin(codec, "HFR");
> +	} else {
> +		snd_soc_dapm_enable_pin(codec, "HFL");
> +		snd_soc_dapm_enable_pin(codec, "HFR");
> +	}
> +
> +	schedule_work(&jack_work);
> +	return IRQ_HANDLED;
> +}

All this jack handling should be using the standard GPIO based jack
abstraction provided by sound/soc/soc-jack.c.  That will also give
userspace visiblity of the status of the jack, allowing better
application integration.  sdp3430 and ams-delta provide examples of
using the API.


More information about the Alsa-devel mailing list