summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorManoj Gangwal <mgangwal@nvidia.com>2012-03-16 18:55:26 +0530
committerSimone Willett <swillett@nvidia.com>2012-04-06 13:45:08 -0700
commit4a4d99fa97ca5eead786d7a235f45133af9a1a4a (patch)
tree7614ec1db026d4f0d0399a866369918102f3fc3c /sound/soc
parente90779216bacf8dcd76efd8e167e9cc3e4b46d28 (diff)
asoc: tegra: ALC5640 machine: Fix ext mic detect issue
Enable/disable the ext mic depending on the jack notification for insertion/removal comes.This is done to save the Audio power. Bug 955019 Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com> (cherry picked from commit 7a22037fd4a274637a5bdb18a8c5452fe58aad32) Change-Id: I1a8b47c4e9c424a914f546b48c86a6fb07d8e42a Reviewed-on: http://git-master/r/93956 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/tegra/tegra_rt5640.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index 9fed84be8d50..e7d58803f7c9 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -277,11 +277,14 @@ static int tegra_rt5640_jack_notifier(struct notifier_block *self,
struct snd_soc_codec *codec = jack->codec;
struct snd_soc_card *card = codec->card;
struct tegra_rt5640 *machine = snd_soc_card_get_drvdata(card);
+ struct tegra_rt5640_platform_data *pdata = machine->pdata;
enum headset_state state = BIT_NO_HEADSET;
unsigned char status_jack;
if (jack == &tegra_rt5640_hp_jack) {
if (action) {
+ /* Enable ext mic; enable signal is active-low */
+ gpio_direction_output(pdata->gpio_ext_mic_en, 0);
if (!strncmp(machine->pdata->codec_name, "rt5639", 6))
status_jack = rt5639_headset_detect(codec, 1);
else if (!strncmp(machine->pdata->codec_name, "rt5640",
@@ -302,6 +305,8 @@ static int tegra_rt5640_jack_notifier(struct notifier_block *self,
SND_JACK_MICROPHONE;
}
} else {
+ /* Disable ext mic; enable signal is active-low */
+ gpio_direction_output(pdata->gpio_ext_mic_en, 1);
if (!strncmp(machine->pdata->codec_name, "rt5639", 6))
rt5639_headset_detect(codec, 0);
else if (!strncmp(machine->pdata->codec_name, "rt5640",