ASoC: Tegra: Reset dcnt after each loop
Sumit Bhattacharya [Thu, 2 May 2013 15:46:54 +0000 (20:46 +0530)]
After each loop which decrements dcnt, dcnt should be reset to initial
value. Otherwise in failure condition next loop exit condition will
always fail.

Bug 1281310
Bug 1255915

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

sound/soc/tegra/tegra30_i2s.c

index da18984..22b8f8c 100644 (file)
@@ -830,6 +830,7 @@ static void tegra30_i2s_stop_playback(struct tegra30_i2s *i2s)
                while (tegra30_ahub_tx_fifo_is_enabled(i2s->id) && dcnt--)
                        udelay(100);
 
+               dcnt = 10;
                while (!tegra30_ahub_tx_fifo_is_empty(i2s->id) && dcnt--)
                        udelay(100);
 
@@ -844,7 +845,6 @@ static void tegra30_i2s_stop_playback(struct tegra30_i2s *i2s)
                                udelay(100);
                }
        }
-
 }
 
 static void tegra30_i2s_start_capture(struct tegra30_i2s *i2s)
@@ -865,6 +865,7 @@ static void tegra30_i2s_stop_capture(struct tegra30_i2s *i2s)
                while (tegra30_ahub_rx_fifo_is_enabled(i2s->id) && dcnt--)
                        udelay(100);
 
+               dcnt = 10;
                while (!tegra30_ahub_rx_fifo_is_empty(i2s->id) && dcnt--)
                        udelay(100);