ASoC: Tegra: Fix the issue about capture clock
Lei Fan [Wed, 25 Dec 2013 06:06:19 +0000 (14:06 +0800)]
During a capture, playback_ref_count will be 0 and capture_ref_count
will be 1, the clock tree will not be set. But it needs to be set.

Bug 1429860

Change-Id: Ib40d757d56d7093da92a12ba355d0003d8a1564d
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/351106
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vijay Mali <vmali@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Danny Song <dsong@nvidia.com>

sound/soc/tegra/tegra30_i2s.c

index a80eada..2f74705 100644 (file)
@@ -7,7 +7,7 @@
  * Based on code copyright/by:
  *
  * Copyright (c) 2009-2013, NVIDIA Corporation.
- * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved.
  * Scott Peterson <speterson@nvidia.com>
  *
  * Copyright (C) 2010 Google, Inc.
@@ -543,7 +543,8 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream,
                /* If the I2S is used for voice also, it is not
                *  necessary to set its clock if it had been set
                *  like during voice call.*/
-               if (!(i2s->playback_ref_count - 1)) {
+               if (!(i2s->playback_ref_count - 1) ||
+                       !(i2s->capture_ref_count - 1)) {
                        ret = clk_set_parent(i2s->clk_i2s,
                                i2s->clk_pll_a_out0);
                        if (ret) {