summaryrefslogtreecommitdiff
path: root/sound/soc/tegra
diff options
context:
space:
mode:
authorNikesh Oswal <noswal@nvidia.com>2011-02-08 17:56:12 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-02-08 18:21:02 -0800
commit49111eb5b680a9f2e2ea196ffaf7dd80a7f02e93 (patch)
tree243f6709aa5955e82d2e64fa68bc243127105125 /sound/soc/tegra
parent61e45968dc24a96becbcaabfb3cc29997e2a3bba (diff)
[tegra alsa] use generic codec DAI
- use generic codec DAI for BT-SCO usecase Change-Id: Ied03e0ce2617d7b9ce8c8fd176f0b601a8896796 Reviewed-on: http://git-master/r/18716 Tested-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'sound/soc/tegra')
-rw-r--r--sound/soc/tegra/tegra_soc_wm8753.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra_soc_wm8753.c b/sound/soc/tegra/tegra_soc_wm8753.c
index 103774e60639..761e45078494 100644
--- a/sound/soc/tegra/tegra_soc_wm8753.c
+++ b/sound/soc/tegra/tegra_soc_wm8753.c
@@ -103,6 +103,7 @@ static struct platform_device *tegra_snd_device;
static struct regulator* wm8753_reg;
extern struct snd_soc_dai tegra_i2s_dai[];
+extern struct snd_soc_dai tegra_generic_codec_dai[];
extern struct snd_soc_platform tegra_soc_platform;
static int tegra_hifi_hw_params(struct snd_pcm_substream *substream,
@@ -280,12 +281,36 @@ static int tegra_hifi_hw_free(struct snd_pcm_substream *substream)
return 0;
}
+
static int tegra_voice_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
+ struct snd_pcm_hw_params *params)
+
{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+ int err;
+
+ err = snd_soc_dai_set_fmt(cpu_dai,
+ SND_SOC_DAIFMT_DSP_A | \
+ SND_SOC_DAIFMT_NB_NF | \
+ SND_SOC_DAIFMT_CBS_CFS);
+
+ if (err < 0) {
+ pr_err("cpu_dai fmt not set \n");
+ return err;
+ }
+
+ err = snd_soc_dai_set_sysclk(cpu_dai, 0, I2S2_CLK, SND_SOC_CLOCK_IN);
+
+ if (err < 0) {
+ pr_err("cpu_dai clock not set\n");
+ return err;
+ }
+
return 0;
}
+
static int tegra_voice_hw_free(struct snd_pcm_substream *substream)
{
return 0;
@@ -320,7 +345,7 @@ static struct snd_soc_dai_link tegra_soc_dai[] = {
.name = "WM8753",
.stream_name = "WM8753 Voice",
.cpu_dai = &tegra_i2s_dai[1],
- .codec_dai = &wm8753_dai[WM8753_DAI_VOICE],
+ .codec_dai = &tegra_generic_codec_dai[0],
.init = tegra_codec_init,
.ops = &tegra_voice_ops,
},