summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNitin Pai <npai@nvidia.com>2011-07-21 16:43:23 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-07-22 17:58:18 -0700
commitc1a30671f356100ff1e47d524244f01dddbaafc2 (patch)
treea801211fb07ff6edd2fa46552078aeaac0bb2230 /sound
parent58b2cae608fbcfd756d07350ccb1fd296765c92f (diff)
tegra: alsa: Added support for I2S TDM modes
Added DAS functions to do custom connections where routing is not involved. Added support for the tegra_pcm_tdm_hardware for handling the latency. Addded support for the tegra_soc driver for AD1937 Codec Made generic codec dais to be common for all platform of Tegra Change-Id: I20a513f27f39273064ce90b973014c418e6d1362 Signed-off-by: Nitin Pai <npai@nvidia.com> Reviewed-on: http://git-master/r/42360 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/Makefile1
-rw-r--r--sound/soc/tegra/tegra_generic_codec.c7
-rw-r--r--sound/soc/tegra/tegra_i2s.c41
-rw-r--r--sound/soc/tegra/tegra_pcm.c41
-rw-r--r--sound/soc/tegra/tegra_soc.h12
-rw-r--r--sound/soc/tegra/tegra_soc_ad193x.c271
-rw-r--r--sound/soc/tegra/tegra_soc_max98088.c4
-rw-r--r--sound/soc/tegra/tegra_soc_wm8753.c2
-rw-r--r--sound/soc/tegra/tegra_soc_wm8903.c4
9 files changed, 347 insertions, 36 deletions
diff --git a/sound/soc/tegra/Makefile b/sound/soc/tegra/Makefile
index 5f08d958c572..a0a3958ee2dd 100644
--- a/sound/soc/tegra/Makefile
+++ b/sound/soc/tegra/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_TEGRA_GENERIC_CODEC)+= tegra_generic_codec.o
obj-$(CONFIG_SND_SOC_WM8903) += tegra_soc_wm8903.o
obj-$(CONFIG_SND_SOC_WM8753) += tegra_soc_wm8753.o
obj-$(CONFIG_SND_SOC_MAX98088) += tegra_soc_max98088.o
+obj-$(CONFIG_SND_SOC_AD193X) += tegra_soc_ad193x.o
diff --git a/sound/soc/tegra/tegra_generic_codec.c b/sound/soc/tegra/tegra_generic_codec.c
index bccfc51909e9..758f046516fd 100644
--- a/sound/soc/tegra/tegra_generic_codec.c
+++ b/sound/soc/tegra/tegra_generic_codec.c
@@ -99,15 +99,12 @@ static struct snd_soc_dai_ops tegra_generic_codec_stub_ops = {
struct snd_soc_dai tegra_generic_codec_dai[] = {
TEGRA_CREATE_GENERIC_CODEC_DAI("tegra_generic_spdif_codec",
0, 2, 2, TEGRA_SAMPLE_RATES),
-#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
- TEGRA_CREATE_GENERIC_CODEC_DAI("tegra_generic_voice_codec",
- 1, 1, 1, TEGRA_VOICE_SAMPLE_RATES),
-#else
TEGRA_CREATE_GENERIC_CODEC_DAI("tegra_generic_BB_codec",
1, 1, 1, TEGRA_VOICE_SAMPLE_RATES),
TEGRA_CREATE_GENERIC_CODEC_DAI("tegra_generic_BT_codec",
2, 1, 1, TEGRA_VOICE_SAMPLE_RATES),
-#endif
+ TEGRA_CREATE_GENERIC_CODEC_DAI("tegra_generic_tdm_codec",
+ 3, 1, 16, TEGRA_VOICE_SAMPLE_RATES),
};
EXPORT_SYMBOL_GPL(tegra_generic_codec_dai);
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
index 93d84ba39337..5828eb9e305c 100644
--- a/sound/soc/tegra/tegra_i2s.c
+++ b/sound/soc/tegra/tegra_i2s.c
@@ -21,18 +21,6 @@
#include "tegra_soc.h"
-/* i2s controller */
-struct tegra_i2s_info {
- struct platform_device *pdev;
- struct tegra_audio_platform_data *pdata;
-
- unsigned int bit_format;
- bool i2s_master;
- int ref_count;
- aud_dev_info i2sdev_info;
- struct das_regs_cache das_regs;
-};
-
extern int tegra_i2sloopback_func;
void free_i2s_dma_request(struct snd_pcm_substream *substream)
@@ -230,11 +218,13 @@ static int tegra_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_A:
- val1 = AUDIO_FRAME_FORMAT_DSP;
+ val1 = info->pdata->tdm_enable ? AUDIO_FRAME_FORMAT_TDM :
+ AUDIO_FRAME_FORMAT_DSP;
val2 = AUDIO_LRCK_RIGHT_LOW;
break;
case SND_SOC_DAIFMT_DSP_B:
- val1 = AUDIO_FRAME_FORMAT_DSP;
+ val1 = info->pdata->tdm_enable ? AUDIO_FRAME_FORMAT_TDM :
+ AUDIO_FRAME_FORMAT_DSP;
val2 = AUDIO_LRCK_RIGHT_LOW;
break;
case SND_SOC_DAIFMT_I2S:
@@ -307,6 +297,15 @@ static int i2s_configure(struct tegra_i2s_info *info )
dev_fmt.audiomode = pdata->mode;
dev_fmt.clkrate = pdata->dev_clk_rate;
dev_fmt.fifofmt = pdata->fifo_fmt;
+ dev_fmt.total_slots = pdata->total_slots;
+ dev_fmt.rx_slot_enables = pdata->rx_slot_enables;
+ dev_fmt.tx_slot_enables = pdata->tx_slot_enables;
+ dev_fmt.tdm_bitsize = pdata->tdm_bitsize;
+ dev_fmt.total_slots = pdata->total_slots;
+ dev_fmt.tx_bit_offset = pdata->tx_bit_offset;
+ dev_fmt.rx_bit_offset = pdata->rx_bit_offset;
+ dev_fmt.fsync_width = pdata->fsync_width;
+
memset(&strm_fmt, 0, sizeof(strm_fmt));
strm_fmt.bitsize = pdata->bit_size;
@@ -367,7 +366,7 @@ static void tegra_i2s_shutdown(struct snd_pcm_substream *substream,
struct tegra_i2s_info *info = dai->private_data;
if (info->ref_count > 0)
- info->ref_count--;
+ info->ref_count--;
if (!info->ref_count)
am_clock_disable(&info->i2sdev_info);
@@ -414,13 +413,13 @@ static struct snd_soc_dai_ops tegra_i2s_dai_ops = {
struct snd_soc_dai tegra_i2s_dai[] = {
#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
- TEGRA_I2S_CREATE_DAI(0, 1, 2, TEGRA_SAMPLE_RATES),
- TEGRA_I2S_CREATE_DAI(1, 1, 2, TEGRA_SAMPLE_RATES),
+ TEGRA_I2S_CREATE_DAI(0, 1, 16, TEGRA_SAMPLE_RATES),
+ TEGRA_I2S_CREATE_DAI(1, 1, 16, TEGRA_SAMPLE_RATES),
#else
- TEGRA_I2S_CREATE_DAI(0, 2, 2, TEGRA_SAMPLE_RATES),
- TEGRA_I2S_CREATE_DAI(1, 2, 2, TEGRA_SAMPLE_RATES),
- TEGRA_I2S_CREATE_DAI(2, 1, 2, TEGRA_VOICE_SAMPLE_RATES),
- TEGRA_I2S_CREATE_DAI(3, 1, 2, TEGRA_VOICE_SAMPLE_RATES),
+ TEGRA_I2S_CREATE_DAI(0, 2, 16, TEGRA_SAMPLE_RATES),
+ TEGRA_I2S_CREATE_DAI(1, 2, 16, TEGRA_SAMPLE_RATES),
+ TEGRA_I2S_CREATE_DAI(2, 1, 16, TEGRA_VOICE_SAMPLE_RATES),
+ TEGRA_I2S_CREATE_DAI(3, 1, 16, TEGRA_VOICE_SAMPLE_RATES),
#endif
};
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index 4b0554522be2..860267e6ebe6 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -24,6 +24,7 @@
#define PLAYBACK_STARTED true
#define PLAYBACK_STOPPED false
+
static const struct snd_pcm_hardware tegra_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
@@ -41,6 +42,24 @@ static const struct snd_pcm_hardware tegra_pcm_hardware = {
.fifo_size = 4,
};
+/* The Latency (Period Size) for TDM can be changed below */
+static const struct snd_pcm_hardware tegra_pcm_tdm_hardware = {
+ .info = SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_PAUSE |
+ SNDRV_PCM_INFO_RESUME |
+ SNDRV_PCM_INFO_MMAP |
+ SNDRV_PCM_INFO_MMAP_VALID ,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ .channels_min = 8,
+ .channels_max = 16,
+ .buffer_bytes_max = 1024 * 16 * 4,
+ .period_bytes_min = 1024 * 16,
+ .period_bytes_max = 1024 * 16,
+ .periods_min = 4,
+ .periods_max = 4,
+ .fifo_size = 4,
+};
+
static void tegra_pcm_queue_dma(struct tegra_runtime_data *prtd)
{
struct snd_pcm_substream *substream = prtd->substream;
@@ -185,9 +204,11 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
struct tegra_runtime_data *prtd = 0;
+ struct tegra_i2s_info *info = cpu_dai->private_data;
int i, ret=0;
+ int dma_mode;
- pr_debug("%s: Device %d, Stream %s, substream_name %s \n", __func__, \
+ pr_debug("%s: Device %d, Stream %s, substream_name %s\n", __func__, \
substream->pcm->device, \
(substream->stream == SNDRV_PCM_STREAM_PLAYBACK)?"Playback": \
"Capture", substream->name);
@@ -203,7 +224,7 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
/* Ensure buffer size is multiple of period size */
ret = snd_pcm_hw_constraint_integer(runtime,
- SNDRV_PCM_HW_PARAM_PERIODS);
+ SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0) {
pr_err("%s:snd_pcm_hw_constraint_integer failed: %d\n",
__func__, ret);
@@ -238,8 +259,11 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
}
}
+ dma_mode = info->pdata->tdm_enable ? TEGRA_DMA_MODE_CONTINUOUS_DOUBLE :
+ TEGRA_DMA_MODE_CONTINUOUS_SINGLE;
+
prtd->dma_chan = tegra_dma_allocate_channel(
- TEGRA_DMA_MODE_CONTINUOUS_SINGLE, "pcm");
+ dma_mode, "pcm");
if (prtd->dma_chan == NULL) {
pr_err("%s: could not allocate DMA channel for PCM:\n",
__func__);
@@ -257,7 +281,11 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
#endif
/* Set HW params now that initialization is complete */
- snd_soc_set_runtime_hwparams(substream, &tegra_pcm_hardware);
+ if (!info->pdata->tdm_enable)
+ snd_soc_set_runtime_hwparams(substream, &tegra_pcm_hardware);
+ else
+ snd_soc_set_runtime_hwparams(substream,
+ &tegra_pcm_tdm_hardware);
goto end;
@@ -339,7 +367,10 @@ static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
{
struct snd_pcm_substream *substream = pcm->streams[stream].substream;
struct snd_dma_buffer *buf = &substream->dma_buffer;
- size_t size = tegra_pcm_hardware.buffer_bytes_max;
+ size_t size;
+
+ size = max(tegra_pcm_hardware.buffer_bytes_max,
+ tegra_pcm_tdm_hardware.buffer_bytes_max);
buf->area = dma_alloc_writecombine(pcm->card->dev, size,
&buf->addr, GFP_KERNEL);
diff --git a/sound/soc/tegra/tegra_soc.h b/sound/soc/tegra/tegra_soc.h
index 539b46fbaa5b..7e262bd2c34d 100644
--- a/sound/soc/tegra/tegra_soc.h
+++ b/sound/soc/tegra/tegra_soc.h
@@ -122,6 +122,18 @@ struct tegra_audio_data {
int codec_con;
};
+/* i2s controller */
+struct tegra_i2s_info {
+ struct platform_device *pdev;
+ struct tegra_audio_platform_data *pdata;
+
+ unsigned int bit_format;
+ bool i2s_master;
+ int ref_count;
+ aud_dev_info i2sdev_info;
+ struct das_regs_cache das_regs;
+};
+
void tegra_ext_control(struct snd_soc_codec *codec, int new_con);
int tegra_controls_init(struct snd_soc_codec *codec);
diff --git a/sound/soc/tegra/tegra_soc_ad193x.c b/sound/soc/tegra/tegra_soc_ad193x.c
new file mode 100644
index 000000000000..b52a172b231f
--- /dev/null
+++ b/sound/soc/tegra/tegra_soc_ad193x.c
@@ -0,0 +1,271 @@
+/*
+ * tegra_soc_ad193x.c -- SoC audio for tegra
+ *
+ * (c) 2010-2011 Nvidia Graphics Pvt. Ltd.
+ * http://www.nvidia.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "tegra_soc.h"
+#include <sound/soc-dapm.h>
+#include "../codecs/ad193x.h"
+
+static struct platform_device *tegra_snd_device;
+
+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,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+ struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+ int dai_flag = 0, sys_clk;
+ int err;
+ int num_chans;
+ int mode;
+
+ enum dac_dap_data_format data_fmt;
+
+#ifdef CONFIG_ARCH_TEGRA_2x_SOC
+ if (tegra_das_is_port_master(tegra_audio_codec_type_hifi))
+ dai_flag |= SND_SOC_DAIFMT_CBM_CFM;
+ else
+#endif
+ dai_flag |= SND_SOC_DAIFMT_CBS_CFS;
+
+ dai_flag |= SND_SOC_DAIFMT_DSP_A;
+
+ err = snd_soc_dai_set_fmt(codec_dai, dai_flag);
+ if (err < 0) {
+ pr_err("codec_dai fmt not set\n");
+ return err;
+ }
+ err = snd_soc_dai_set_fmt(cpu_dai, dai_flag);
+ if (err < 0) {
+ pr_err("cpu_dai fmt not set\n");
+ return err;
+ }
+
+ /*FIXME: not sure this is the right way.
+ This should be samplerate times 256 or 128 based on codec need */
+ sys_clk = 48000 * 512;
+ err = snd_soc_dai_set_sysclk(codec_dai, 0, sys_clk, SND_SOC_CLOCK_IN);
+ if (err < 0) {
+ pr_err("codec_dai clock not set\n");
+ return err;
+ }
+ err = snd_soc_dai_set_sysclk(cpu_dai, 0, sys_clk, SND_SOC_CLOCK_IN);
+ if (err < 0) {
+ pr_err("cpu_dai clock not set\n");
+ return err;
+ }
+
+ data_fmt = tegra_das_get_codec_data_fmt(tegra_audio_codec_type_hifi);
+ if (!(data_fmt & dac_dap_data_format_tdm)) {
+ mode = snd_soc_read(codec_dai, AD193X_DAC_CTRL0);
+ mode &= ~(AD193X_DAC_SERFMT_MASK);
+ mode |= AD193X_DAC_SERFMT_STEREO;
+ snd_soc_write(codec_dai, AD193X_DAC_CTRL0, mode);
+ snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 0xFF, 2, 32);
+ } else {
+ /* set codec DAI slots, 8 channels, all channels are enabled */
+ num_chans = codec_dai->id == 0 ? 4 : 8;
+ snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 0xFF, num_chans, 32);
+ }
+
+ return 0;
+}
+
+void tegra_ext_control(struct snd_soc_codec *codec, int new_con)
+{
+ return;
+}
+
+int tegra_codec_startup(struct snd_pcm_substream *substream)
+{
+ tegra_das_power_mode(true);
+
+ return 0;
+}
+
+void tegra_codec_shutdown(struct snd_pcm_substream *substream)
+{
+ tegra_das_power_mode(false);
+}
+
+int tegra_soc_suspend_pre(struct platform_device *pdev, pm_message_t state)
+{
+ return 0;
+}
+
+int tegra_soc_suspend_post(struct platform_device *pdev, pm_message_t state)
+{
+ tegra_das_disable_mclk();
+
+ return 0;
+}
+
+int tegra_soc_resume_pre(struct platform_device *pdev)
+{
+ tegra_das_enable_mclk();
+
+ return 0;
+}
+
+int tegra_soc_resume_post(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct snd_soc_ops tegra_hifi_ops = {
+ .hw_params = tegra_hifi_hw_params,
+ .startup = tegra_codec_startup,
+ .shutdown = tegra_codec_shutdown,
+};
+
+static int tegra_codec_init(struct snd_soc_codec *codec)
+{
+ struct tegra_audio_data *audio_data = codec->socdev->codec_data;
+ int err = 0;
+
+ if (!audio_data->init_done) {
+
+ err = tegra_das_open();
+ if (err) {
+ pr_err("Failed get dap mclk\n");
+ err = -ENODEV;
+ goto ad193x_init_fail;
+ }
+
+ err = tegra_das_enable_mclk();
+ if (err) {
+ pr_err("Failed to enable dap mclk\n");
+ err = -ENODEV;
+ goto ad193x_init_fail;
+ }
+
+ err = tegra_controls_init(codec);
+ if (err < 0) {
+ pr_err("Failed in controls init\n");
+ goto ad193x_init_fail;
+ }
+
+ audio_data->codec = codec;
+ audio_data->init_done = 1;
+ }
+
+ return err;
+
+ad193x_init_fail:
+
+ tegra_das_disable_mclk();
+ tegra_das_close();
+ return err;
+}
+
+#define TEGRA_CREATE_SOC_DAI_LINK(xname, xstreamname, \
+ xcpudai, xcodecdai, xops) \
+{ \
+ .name = xname, \
+ .stream_name = xstreamname, \
+ .cpu_dai = xcpudai, \
+ .codec_dai = xcodecdai, \
+ .init = tegra_codec_init, \
+ .ops = xops, \
+}
+
+/* Currently both the DAI link to the same CODEC dai
+ * as only one of them can be active at the same time
+ * */
+static struct snd_soc_dai_link tegra_soc_dai[] = {
+ TEGRA_CREATE_SOC_DAI_LINK("AD1937", "AD1937 Multi-8",
+ &tegra_i2s_dai[0], &ad193x_dai,
+ &tegra_hifi_ops),
+
+ TEGRA_CREATE_SOC_DAI_LINK("AD1937", "Generic Multi-16",
+ &tegra_i2s_dai[1],
+ &tegra_generic_codec_dai[3], &tegra_hifi_ops),
+};
+
+static struct tegra_audio_data audio_data = {
+ .init_done = 0,
+ .play_device = TEGRA_AUDIO_DEVICE_NONE,
+ .capture_device = TEGRA_AUDIO_DEVICE_NONE,
+ .is_call_mode = false,
+ .codec_con = TEGRA_AUDIO_OFF,
+};
+
+static struct snd_soc_card tegra_snd_soc = {
+ .name = "tegra",
+ .platform = &tegra_soc_platform,
+ .dai_link = tegra_soc_dai,
+ .num_links = ARRAY_SIZE(tegra_soc_dai),
+ .suspend_pre = tegra_soc_suspend_pre,
+ .suspend_post = tegra_soc_suspend_post,
+ .resume_pre = tegra_soc_resume_pre,
+ .resume_post = tegra_soc_resume_post,
+};
+
+static struct snd_soc_device tegra_snd_devdata = {
+ .card = &tegra_snd_soc,
+ .codec_dev = &soc_codec_dev_ad193x,
+ .codec_data = &audio_data,
+};
+
+static int __init tegra_init(void)
+{
+ int ret = 0;
+
+ tegra_snd_device = platform_device_alloc("soc-audio", -1);
+ if (!tegra_snd_device) {
+ pr_err("failed to allocate soc-audio\n");
+ return -ENOMEM;
+ }
+
+ platform_set_drvdata(tegra_snd_device, &tegra_snd_devdata);
+ tegra_snd_devdata.dev = &tegra_snd_device->dev;
+
+ ret = platform_device_add(tegra_snd_device);
+ if (ret) {
+ pr_err("audio device could not be added\n");
+ goto fail;
+ }
+
+ return 0;
+
+fail:
+ if (tegra_snd_device) {
+ platform_device_put(tegra_snd_device);
+ tegra_snd_device = 0;
+ }
+
+ return ret;
+}
+
+static void __exit tegra_exit(void)
+{
+ platform_device_unregister(tegra_snd_device);
+}
+
+module_init(tegra_init);
+module_exit(tegra_exit);
+
+/* Module information */
+MODULE_DESCRIPTION("Tegra ALSA SoC for AD193X");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/tegra/tegra_soc_max98088.c b/sound/soc/tegra/tegra_soc_max98088.c
index 0de23df927d1..5b15760fa7a5 100644
--- a/sound/soc/tegra/tegra_soc_max98088.c
+++ b/sound/soc/tegra/tegra_soc_max98088.c
@@ -497,8 +497,8 @@ static struct snd_soc_dai_link tegra_soc_dai[] = {
&tegra_hifi_ops),
#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
- TEGRA_CREATE_SOC_DAI_LINK("Tegra-generic", "Tegra Generic Voice",
- &tegra_i2s_dai[1], &tegra_generic_codec_dai[1],
+ TEGRA_CREATE_SOC_DAI_LINK("Tegra-generic", "Tegra BT Voice",
+ &tegra_i2s_dai[1], &tegra_generic_codec_dai[2],
&tegra_voice_ops),
#else
/*
diff --git a/sound/soc/tegra/tegra_soc_wm8753.c b/sound/soc/tegra/tegra_soc_wm8753.c
index 0e33b09b4fa7..0fc9b16cf810 100644
--- a/sound/soc/tegra/tegra_soc_wm8753.c
+++ b/sound/soc/tegra/tegra_soc_wm8753.c
@@ -726,7 +726,7 @@ static struct snd_soc_dai_link tegra_soc_dai[] = {
&tegra_spdif_dai, &tegra_generic_codec_dai[0],
&tegra_spdif_ops),
TEGRA_CREATE_SOC_DAI_LINK("Tegra-generic", "Tegra Generic Voice",
- &tegra_i2s_dai[1], &tegra_generic_codec_dai[1],
+ &tegra_i2s_dai[1], &tegra_generic_codec_dai[2],
&tegra_voice_ops),
#endif
};
diff --git a/sound/soc/tegra/tegra_soc_wm8903.c b/sound/soc/tegra/tegra_soc_wm8903.c
index 0ef8e7f009ee..00efb97a9710 100644
--- a/sound/soc/tegra/tegra_soc_wm8903.c
+++ b/sound/soc/tegra/tegra_soc_wm8903.c
@@ -545,8 +545,8 @@ static struct snd_soc_dai_link tegra_soc_dai[] = {
TEGRA_CREATE_SOC_DAI_LINK("WM8903", "WM8903 HiFi",
&tegra_i2s_dai[0], &wm8903_dai, &tegra_hifi_ops),
- TEGRA_CREATE_SOC_DAI_LINK("Tegra-generic", "Tegra Generic Voice",
- &tegra_i2s_dai[1], &tegra_generic_codec_dai[1],
+ TEGRA_CREATE_SOC_DAI_LINK("Tegra-generic", "Tegra BT Voice",
+ &tegra_i2s_dai[1], &tegra_generic_codec_dai[2],
&tegra_voice_ops),
#else
TEGRA_CREATE_SOC_DAI_LINK("WM8903", "WM8903 HiFi",