asoc: tegra: aic326x: support bt sco playback and recording
Nikesh Oswal [Sat, 4 Feb 2012 05:11:08 +0000 (10:11 +0530)]
support bt sco playback and recording with bt chip as master
and ap-i2s as slave

Change-Id: I0e1bcd6fa71a234a90c830195a7eb2015f71a3b0
Signed-off-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-on: http://git-master/r/84529
Reviewed-by: Scott Peterson <speterson@nvidia.com>

Rebase-Id: Ra636b69e7851a4070d8f3b9ba1b60e65f8a98080

sound/soc/tegra/tegra_aic326x.c

index 922cff4..2ca52d2 100644 (file)
@@ -369,13 +369,27 @@ static int tegra_aic326x_bt_hw_params(struct snd_pcm_substream *substream,
        err = snd_soc_dai_set_fmt(rtd->cpu_dai,
                        SND_SOC_DAIFMT_DSP_A |
                        SND_SOC_DAIFMT_NB_NF |
-                       SND_SOC_DAIFMT_CBS_CFS);
+                       SND_SOC_DAIFMT_CBM_CFM);
        if (err < 0) {
                dev_err(rtd->codec->card->dev, "cpu_dai fmt not set\n");
                return err;
        }
 
-#ifndef CONFIG_ARCH_TEGRA_2x_SOC
+#ifdef CONFIG_ARCH_TEGRA_2x_SOC
+       err = tegra20_das_connect_dac_to_dap(TEGRA20_DAS_DAP_SEL_DAC2,
+                                       TEGRA20_DAS_DAP_ID_4);
+       if (err < 0) {
+               dev_err(card->dev, "failed to set dac-dap path\n");
+               return err;
+       }
+
+       err = tegra20_das_connect_dap_to_dac(TEGRA20_DAS_DAP_ID_4,
+                                       TEGRA20_DAS_DAP_SEL_DAC2);
+       if (err < 0) {
+               dev_err(card->dev, "failed to set dac-dap path\n");
+               return err;
+       }
+#else
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                tegra_aic326x_set_dam_cif(i2s->dam_ifc, params_rate(params),
                                params_channels(params), sample_size);