asoc: tegra: init cache values for i2s register
Ken Chang [Fri, 9 Dec 2011 00:05:51 +0000 (08:05 +0800)]
init i2s->reg_cache[] by reading i2s regs in probe function.

bug 911332

Change-Id: I58711b5b8a1866878e9de02144396883df6ff3da
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: http://git-master/r/69081
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>

Rebase-Id: R9cbdeee6b316f6cb6bb28c1cafd4a962b669c414

sound/soc/tegra/tegra30_i2s.c

index 81b4760..a789dbb 100644 (file)
@@ -447,10 +447,19 @@ static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
 static int tegra30_i2s_probe(struct snd_soc_dai *dai)
 {
        struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+       int i;
 
        dai->capture_dma_data = &i2s->capture_dma_data;
        dai->playback_dma_data = &i2s->playback_dma_data;
 
+       tegra30_i2s_enable_clocks(i2s);
+
+       /*cache the POR values of i2s regs*/
+       for (i = 0; i < ((TEGRA30_I2S_CIF_TX_CTRL>>2) + 1); i++)
+               i2s->reg_cache[i] = tegra30_i2s_read(i2s, i<<2);
+
+       tegra30_i2s_disable_clocks(i2s);
+
        return 0;
 }