asoc: tegra-alt: Set I2S2 bclk ratio and slot ctrl
Rahul Mittal [Fri, 26 Sep 2014 16:55:58 +0000 (21:55 +0530)]
Set I2S2 bclk ratio for DSP mode
Set slot ctrl for I2S2

Bug 200032907
Bug 200037283

Change-Id: I0b65dc2e473c29ebcc8bec0780907784fd25fa5f
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-on: http://git-master/r/499376
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

sound/soc/tegra-alt/tegra_t210ref_mobile_es755_alt.c

index e2ce99d..df4ff70 100644 (file)
@@ -209,6 +209,23 @@ static int tegra_t210ref_dai_init(struct snd_soc_pcm_runtime *rtd,
                }
        }
 
+       idx = tegra_machine_get_codec_dai_link_idx("spdif-dit-1");
+       if (idx != -EINVAL) {
+               err = snd_soc_dai_set_bclk_ratio(card->rtd[idx].cpu_dai,
+                       tegra_machine_get_bclk_ratio(&card->rtd[idx]));
+               if (err < 0) {
+                       dev_err(card->dev, "Can't set cpu dai bclk ratio\n");
+                       return err;
+               }
+
+               err = snd_soc_dai_set_tdm_slot(card->rtd[idx].cpu_dai,
+                       (1 << channels) - 1, (1 << channels) - 1, 0, 0);
+               if (err < 0) {
+                       dev_err(card->dev, "Can't set cpu dai slot ctrl\n");
+                       return err;
+               }
+       }
+
        return 0;
 }