ASoC:Tegra: Fix DAM num to a specific DAP
Lei Fan [Sat, 4 Jan 2014 12:53:55 +0000 (20:53 +0800)]
DAM should fix to a specific DAP, otherwise voice call cannot be
ended normally.

Change-Id: I60553e903a2f425bc9e9e1c245f77dfd5d3058b4
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/351993
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vijay Mali <vmali@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Martin Chi <mchi@nvidia.com>

sound/soc/tegra/tegra30_i2s.c

index 2f74705..b7ec64f 100644 (file)
@@ -1004,7 +1004,7 @@ int tegra30_i2s_resume(struct snd_soc_dai *cpu_dai)
 
        tegra30_i2s_disable_clocks(i2s);
 
-       if (i2s->dam_ch_refcount)
+       if (i2s->dam_ch_refcount > 1)
                ret = tegra30_dam_resume(i2s->dam_ifc);
 
        return ret;
@@ -1787,6 +1787,22 @@ static __devinit int tegra30_i2s_platform_probe(struct platform_device *pdev)
        i2s = &i2scont[pdev->id];
        dev_set_drvdata(&pdev->dev, i2s);
        i2s->id = pdev->id;
+       switch (i2s->id) {
+       case 0:
+               i2s->dam_ifc = 1;
+               break;
+       case 1:
+               i2s->dam_ifc = 0;
+               break;
+       case 2:
+               break;
+       case 3:
+               i2s->dam_ifc = 2;
+               break;
+       default:
+               break;
+       }
+       i2s->dam_ch_refcount++;
 
        i2s->clk_i2s = clk_get(&pdev->dev, "i2s");
        if (IS_ERR(i2s->clk_i2s)) {