On Thu, Nov 19, 2009 at 09:18:09AM -0800, Gregoire Gentil wrote:
> Signed-off-by: Gregoire Gentil <[email protected]>
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html