diff options
author | Sumit Bhattacharya <sumitb@nvidia.com> | 2011-02-21 16:12:16 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-02-22 18:10:06 -0800 |
commit | 44d15e83d697ebc2a1f8b7717d66f9c007371333 (patch) | |
tree | 4685961a53c367eaad98e2682ebd3bed7b5d3e84 /sound | |
parent | 6737c844504a237536fd14327f416069ca2ec7f2 (diff) |
tegra-alsa: Cache das registers before suspend
Caching das registers before system suspend and restoring
them during system resume. Also moved das power mode calls
from tegra_pcm to tegra_i2s interface.
Bug 792879
Bug 789967
Change-Id: I15a5f41a1aab6d74a8f5e29db25a93b26c4d4111
Reviewed-on: http://git-master/r/20292
Tested-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Vijay Mali <vmali@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_i2s.c | 9 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_pcm.c | 11 |
2 files changed, 9 insertions, 11 deletions
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c index 6f62d2ce36ef..9055a3121219 100644 --- a/sound/soc/tegra/tegra_i2s.c +++ b/sound/soc/tegra/tegra_i2s.c @@ -35,6 +35,7 @@ struct tegra_i2s_info { /* Control for whole I2S (Data format, etc.) */ unsigned int bit_format; struct i2s_runtime_data i2s_regs; + struct das_regs_cache das_regs; }; void setup_dma_request(struct snd_pcm_substream *substream, @@ -354,6 +355,7 @@ int tegra_i2s_suspend(struct snd_soc_dai *cpu_dai) struct tegra_i2s_info *info = cpu_dai->private_data; i2s_get_all_regs(cpu_dai->id, &info->i2s_regs); + tegra_das_get_all_regs(&info->das_regs); return 0; } @@ -362,6 +364,7 @@ int tegra_i2s_resume(struct snd_soc_dai *cpu_dai) { struct tegra_i2s_info *info = cpu_dai->private_data; + tegra_das_set_all_regs(&info->das_regs); i2s_set_all_regs(cpu_dai->id, &info->i2s_regs); return 0; @@ -380,6 +383,9 @@ static int tegra_i2s_startup(struct snd_pcm_substream *substream, clk_enable(info->dap_mclk); clk_enable(info->audio_sync_clk); + /* set das pins state to normal */ + tegra_das_power_mode(true); + return 0; } @@ -388,6 +394,9 @@ static void tegra_i2s_shutdown(struct snd_pcm_substream *substream, { struct tegra_i2s_info *info = dai->private_data; + /* set das pins state to tristate */ + tegra_das_power_mode(false); + clk_disable(info->dap_mclk); clk_disable(info->audio_sync_clk); diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 1ef79f60dd6a..c982eb6cddb4 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -247,9 +247,6 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream) runtime->private_data = prtd; prtd->substream = substream; - /* set pins state to normal */ - tegra_das_power_mode(true); - prtd->state = STATE_INVALID; setup_dma_request(substream, @@ -283,10 +280,6 @@ fail: tegra_dma_flush(prtd->dma_chan); tegra_dma_free_channel(prtd->dma_chan); } - - /* set pins state to tristate */ - tegra_das_power_mode(false); - kfree(prtd); } @@ -314,10 +307,6 @@ static int tegra_pcm_close(struct snd_pcm_substream *substream) tegra_dma_free_channel(prtd->dma_chan); prtd->dma_chan = NULL; } - - /* set pins state to tristate */ - tegra_das_power_mode(false); - kfree(prtd); return 0; |