From 3620cab8c2db4ae71543b5f4292de1d0e522a138 Mon Sep 17 00:00:00 2001 From: Manoj Gangwal Date: Wed, 25 Apr 2012 18:22:01 +0530 Subject: asoc: tegra: ALC5640 machine:Add support to detect HP in LP0 Add Support to detect the HP insertion or removal during LP0 state. Bug 969405 Change-Id: Ibedf1769338e16877240ea9cc82fa7469eb7ff9e Signed-off-by: Manoj Gangwal Reviewed-on: http://git-master/r/98745 Reviewed-by: Simone Willett Tested-by: Simone Willett --- sound/soc/tegra/tegra_rt5640.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sound') diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c index e5e6c1f826f0..6ca6f76c84aa 100644 --- a/sound/soc/tegra/tegra_rt5640.c +++ b/sound/soc/tegra/tegra_rt5640.c @@ -582,10 +582,26 @@ static struct snd_soc_dai_link tegra_rt5640_dai[] = { }, }; +static int tegra_rt5640_resume_pre(struct snd_soc_card *card) +{ + int val; + struct snd_soc_jack_gpio *gpio = &tegra_rt5640_hp_jack_gpio; + + if (gpio_is_valid(gpio->gpio)) { + val = gpio_get_value(gpio->gpio); + val = gpio->invert ? !val : val; + snd_soc_jack_report(gpio->jack, val, gpio->report); + } + + return 0; +} + + static struct snd_soc_card snd_soc_tegra_rt5640 = { .name = "tegra-rt5640", .dai_link = tegra_rt5640_dai, .num_links = ARRAY_SIZE(tegra_rt5640_dai), + .resume_pre = tegra_rt5640_resume_pre, }; static __devinit int tegra_rt5640_driver_probe(struct platform_device *pdev) -- cgit v1.2.3