summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorVijay Mali <vmali@nvidia.com>2013-03-21 20:39:05 +0530
committerMrutyunjay Sawant <msawant@nvidia.com>2013-03-26 07:58:21 -0700
commit8197f585be3bf75420c30cecec25316bdacf1fd4 (patch)
tree6fda40fa9894959e752dfdd017e3c86132ab7cd9 /sound
parent2340401e2dec7228bcc5d9074c310d0146454736 (diff)
asoc: tegra: aic326x: Use avdd_audio regulator
- Enable avdd_audio regulator during playback on Headphone and Speaker. - This prevent leakage current in codec. - Improve codec power numbers. Bug 1238662 Change-Id: Ie9fa31b6291c06ad4f83138c4e595fb4da29a7f9 Signed-off-by: Vijay Mali <vmali@nvidia.com> Reviewed-on: http://git-master/r/211670 Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Niranjan Wartikar <nwartikar@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_aic326x.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_aic326x.c b/sound/soc/tegra/tegra_aic326x.c
index 9f3119fa9d2b..dbcab64de140 100644
--- a/sound/soc/tegra/tegra_aic326x.c
+++ b/sound/soc/tegra/tegra_aic326x.c
@@ -1108,6 +1108,8 @@ static int tegra_aic326x_event_int_spk(struct snd_soc_dapm_widget *w,
/* set speaker amplifier voulme to 18 dB, E-1 state */
snd_soc_write(codec, AIC3262_SPK_AMP_CNTL_R4, 0x33);
}
+ if (machine->audio_reg)
+ regulator_enable(machine->audio_reg);
} else {
ret = edp_update_client_request(
machine->spk_edp_client,
@@ -1116,6 +1118,8 @@ static int tegra_aic326x_event_int_spk(struct snd_soc_dapm_widget *w,
dev_err(card->dev,
"E+1 state transition failed\n");
}
+ if (machine->audio_reg)
+ regulator_disable(machine->audio_reg);
}
err_null_spk_edp_client:
if (!(machine->gpio_requested & GPIO_SPKR_EN))
@@ -1135,6 +1139,13 @@ static int tegra_aic326x_event_hp(struct snd_soc_dapm_widget *w,
struct tegra_aic326x *machine = snd_soc_card_get_drvdata(card);
struct tegra_asoc_platform_data *pdata = machine->pdata;
+ if (machine->audio_reg) {
+ if (SND_SOC_DAPM_EVENT_ON(event))
+ regulator_enable(machine->audio_reg);
+ else
+ regulator_disable(machine->audio_reg);
+ }
+
if (!(machine->gpio_requested & GPIO_HP_MUTE))
return 0;
@@ -1547,6 +1558,12 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev)
machine->hmic_reg = 0;
}
+ machine->audio_reg = regulator_get(NULL, "avdd_audio");
+ if (IS_ERR(machine->audio_reg)) {
+ dev_info(&pdev->dev, "No avdd_audio regulator found\n");
+ machine->audio_reg = 0;
+ }
+
card->dev = &pdev->dev;
platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);