summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorVinod Subbarayalu <vsubbarayalu@nvidia.com>2013-01-15 18:29:08 -0800
committerMandar Padmawar <mpadmawar@nvidia.com>2013-02-05 06:51:06 -0800
commit9310a5a2580cd9d4442e3c80938877774e359c66 (patch)
tree1e14ca7782754400cc39889973aa7781851fa0a2 /sound
parent836c4691967ffee03e795775879c5a4cfde288b1 (diff)
audio: Power manage Realtek codec when TFA is in use.
Change-Id: I4c32cdde467c597e55eadee54c7a9202ee219975 Signed-off-by: Vinod Subbarayalu <vsubbarayalu@nvidia.com> Reviewed-on: http://git-master/r/191520 Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_rt5640.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index d1280d3d4427..a66b4c6a1532 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -66,6 +66,7 @@
#define GPIO_HP_DET BIT(4)
struct tegra30_i2s *i2s_tfa = NULL;
+struct snd_soc_codec *codec_rt;
struct tegra_rt5640 {
struct tegra_asoc_utils_data util_data;
@@ -437,6 +438,8 @@ static int tegra_rt5640_event_int_spk(struct snd_soc_dapm_widget *w,
if(machine_is_roth()) {
if (SND_SOC_DAPM_EVENT_ON(event)) {
if(i2s_tfa) {
+ if (codec_rt)
+ snd_soc_update_bits(codec_rt, RT5640_PWR_DIG1, 0x0001, 0x0000);
tegra_asoc_enable_clocks();
Tfa9887_Powerdown(0);
tegra_asoc_disable_clocks();
@@ -445,7 +448,7 @@ static int tegra_rt5640_event_int_spk(struct snd_soc_dapm_widget *w,
else {
Tfa9887_Powerdown(1);
}
- }
+ }
if (!(machine->gpio_requested & GPIO_SPKR_EN))
return 0;
@@ -554,6 +557,8 @@ static int tegra_rt5640_init(struct snd_soc_pcm_runtime *rtd)
struct tegra_asoc_platform_data *pdata = machine->pdata;
int ret;
+ codec_rt = codec;
+
if (gpio_is_valid(pdata->gpio_spkr_en)) {
ret = gpio_request(pdata->gpio_spkr_en, "spkr_en");
if (ret) {