asoc: tegra: i2s: Fixes for audio_clock_2x rate
Nitin Pai [Mon, 2 Jul 2012 08:32:31 +0000 (13:32 +0530)]
audio_clock_2x parent needs to be set first before
changing the rate, else it will not work.

Bug 1019017

Signed-off-by: Nitin Pai <npai@nvidia.com>
Reviewed-on: http://git-master/r/116682
(cherry picked from commit fdc4da6d96e7be4aa2accf098de48543e745cf11)
Change-Id: I93aeb1afed8732e8a1b1cff4ab03b9a9f654804f
Reviewed-on: http://git-master/r/118250
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bob Johnston <bjohnston@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

sound/soc/tegra/tegra30_i2s.c

index 72e6447..03ddff5 100644 (file)
@@ -557,6 +557,13 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream,
                        return ret;
                }
 
+               ret = clk_set_parent(clk_get_parent(i2s->clk_audio_2x),
+                                               i2s->clk_i2s_sync);
+               if (ret) {
+                       dev_err(dev, "Can't set parent of audio2x clock\n");
+                       return ret;
+               }
+
                ret = clk_set_rate(i2s->clk_audio_2x, i2sclock);
                if (ret) {
                        dev_err(dev, "Can't set I2S sync clock rate\n");