diff options
author | Dara Ramesh <dramesh@nvidia.com> | 2012-10-16 15:17:05 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-10-26 17:27:50 -0700 |
commit | ae8367a56a2475129b4a44f2e7f43d15a20c5015 (patch) | |
tree | 76cc5396d2de22d5400dc5bb179737ff687c9f91 /sound | |
parent | d4a60c5c86ccc601d132f35125d8a378a985d9aa (diff) |
asoc:tegra: disable ext1 and enable codec bias off
a) disable extern1 clock during OSIdle and suspend
b) enable codec idle bias off
Bug 1158489
Bug 1052069
Bug 1054060
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/144820
(cherry picked from commit 777bbde281ede62a847c3eeb3252957c0a5ee99c)
Change-Id: I8102ece58ca2d208e38fcf2dc72320dfb5d030a1
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-on: http://git-master/r/146966
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/cs42l73.c | 2 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_cs42l73.c | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index 868aa07cf56c..90238bdfd6eb 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c @@ -1289,6 +1289,7 @@ static int cs42l73_probe(struct snd_soc_codec *codec) struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec); codec->control_data = cs42l73->regmap; + codec->dapm.idle_bias_off = 1; ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP); if (ret < 0) { @@ -1318,6 +1319,7 @@ static struct snd_soc_codec_driver soc_codec_dev_cs42l73 = { .suspend = cs42l73_suspend, .resume = cs42l73_resume, .set_bias_level = cs42l73_set_bias_level, + .idle_bias_off = true, .dapm_widgets = cs42l73_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(cs42l73_dapm_widgets), diff --git a/sound/soc/tegra/tegra_cs42l73.c b/sound/soc/tegra/tegra_cs42l73.c index 17442a84d905..25e4044a68d0 100644 --- a/sound/soc/tegra/tegra_cs42l73.c +++ b/sound/soc/tegra/tegra_cs42l73.c @@ -1021,10 +1021,6 @@ static int tegra_cs42l73_init(struct snd_soc_pcm_runtime *rtd) machine->init_done = true; - machine->pcard = card; - machine->bias_level = SND_SOC_BIAS_STANDBY; - machine->clock_enabled = 1; - ret = snd_soc_add_card_controls(card, tegra_cs42l73_controls, ARRAY_SIZE(tegra_cs42l73_controls)); if (ret < 0) @@ -1042,8 +1038,6 @@ static int tegra_cs42l73_init(struct snd_soc_pcm_runtime *rtd) tegra_cs42l73_audio_map, ARRAY_SIZE(tegra_cs42l73_audio_map)); - snd_soc_dapm_sync(dapm); - if (gpio_is_valid(pdata->gpio_hp_det)) { /* Headphone detection */ tegra_cs42l73_hp_jack_gpio.gpio = pdata->gpio_hp_det; @@ -1085,6 +1079,8 @@ static int tegra_cs42l73_init(struct snd_soc_pcm_runtime *rtd) if (ret < 0) return ret; + snd_soc_dapm_sync(dapm); + return 0; } @@ -1140,10 +1136,14 @@ static struct snd_soc_dai_link tegra_cs42l73_dai[NUM_DAI_LINKS] = { static int tegra_cs42l73_suspend_post(struct snd_soc_card *card) { struct snd_soc_jack_gpio *gpio = &tegra_cs42l73_hp_jack_gpio; + struct tegra_cs42l73 *machine = snd_soc_card_get_drvdata(card); if (gpio_is_valid(gpio->gpio)) disable_irq(gpio_to_irq(gpio->gpio)); + if (machine->clock_enabled) + tegra_asoc_utils_clk_disable(&machine->util_data); + return 0; } @@ -1151,6 +1151,7 @@ static int tegra_cs42l73_resume_pre(struct snd_soc_card *card) { int val; struct snd_soc_jack_gpio *gpio = &tegra_cs42l73_hp_jack_gpio; + struct tegra_cs42l73 *machine = snd_soc_card_get_drvdata(card); if (gpio_is_valid(gpio->gpio)) { val = gpio_get_value(gpio->gpio); @@ -1159,6 +1160,9 @@ static int tegra_cs42l73_resume_pre(struct snd_soc_card *card) enable_irq(gpio_to_irq(gpio->gpio)); } + if (!machine->clock_enabled) + tegra_asoc_utils_clk_enable(&machine->util_data); + return 0; } @@ -1242,6 +1246,9 @@ static __devinit int tegra_cs42l73_driver_probe(struct platform_device *pdev) } machine->pdata = pdata; + machine->pcard = card; + machine->bias_level = SND_SOC_BIAS_STANDBY; + machine->clock_enabled = 1; ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev, card); if (ret) @@ -1276,8 +1283,6 @@ static __devinit int tegra_cs42l73_driver_probe(struct platform_device *pdev) platform_set_drvdata(pdev, card); snd_soc_card_set_drvdata(card, machine); - - #ifndef CONFIG_ARCH_TEGRA_2x_SOC for (i = 0; i < NUM_I2S_DEVICES ; i++) { machine->codec_info[i].i2s_id = |