diff options
author | Manoj Gangwal <mgangwal@nvidia.com> | 2012-04-25 18:22:01 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-04-26 15:10:34 -0700 |
commit | 3620cab8c2db4ae71543b5f4292de1d0e522a138 (patch) | |
tree | b3ff84046aba41a1ed7c0b4641befc90dc84504a /sound | |
parent | 4b243bb389f7eecc0d2d50a13b2017d13c567724 (diff) |
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 <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/98745
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_rt5640.c | 16 |
1 files changed, 16 insertions, 0 deletions
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) |