summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorRavindra Lokhande <rlokhande@nvidia.com>2011-04-19 21:14:10 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-05-03 01:26:25 -0700
commite4053f8cd89cd522b2e111f9501ca1a2ebe91688 (patch)
tree7ec4693f5432621dcef175e71ef37e3e6c52ec0d /sound
parent66d8ee30496eaab51c8514d52760a8e2e3f90628 (diff)
tegra alsa: Audio BT SCO support
added support for audio BT sco usecase. For BT sco, i2s is programmed in pcm mode. Change-Id: Iffcfb707cd2c025b78b82e70ba35f89d47a21263 Reviewed-on: http://git-master/r/30042 Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> Tested-by: Ravindra Lokhande <rlokhande@nvidia.com> Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_i2s.c21
-rw-r--r--sound/soc/tegra/tegra_pcm.c5
-rw-r--r--sound/soc/tegra/tegra_soc_wm8903.c15
3 files changed, 31 insertions, 10 deletions
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
index 3285d3c7617c..83dc452f000c 100644
--- a/sound/soc/tegra/tegra_i2s.c
+++ b/sound/soc/tegra/tegra_i2s.c
@@ -169,6 +169,21 @@ static int tegra_i2s_hw_params(struct snd_pcm_substream *substream,
i2s_set_samplerate(i2s_id, val);
+ switch (params_channels(params)) {
+ case 1: val = AUDIO_CHANNEL_1; break;
+ case 2: val = AUDIO_CHANNEL_2; break;
+ case 3: val = AUDIO_CHANNEL_3; break;
+ case 4: val = AUDIO_CHANNEL_4; break;
+ case 5: val = AUDIO_CHANNEL_5; break;
+ case 6: val = AUDIO_CHANNEL_6; break;
+ case 7: val = AUDIO_CHANNEL_7; break;
+ case 8: val = AUDIO_CHANNEL_8; break;
+ default:
+ return -EINVAL;
+ }
+
+ i2s_set_channels(i2s_id, val);
+
return 0;
}
@@ -201,6 +216,7 @@ 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;
+ val2 = AUDIO_LRCK_RIGHT_LOW;
break;
case SND_SOC_DAIFMT_DSP_B:
val1 = AUDIO_FRAME_FORMAT_DSP;
@@ -381,8 +397,8 @@ struct snd_soc_dai tegra_i2s_dai[] = {
TEGRA_I2S_CREATE_DAI(1, 1, 2, TEGRA_SAMPLE_RATES),
#else
TEGRA_I2S_CREATE_DAI(1, 2, 2, TEGRA_SAMPLE_RATES),
- TEGRA_I2S_CREATE_DAI(2, 1, 2, TEGRA_SAMPLE_RATES),
- TEGRA_I2S_CREATE_DAI(3, 1, 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),
#endif
};
@@ -420,6 +436,7 @@ static int tegra_i2s_driver_probe(struct platform_device *pdev)
goto fail_clock;
}
}
+
return 0;
fail_clock:
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index e56ee2d8806d..d5601b2b6f4f 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -190,6 +190,11 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
struct tegra_runtime_data *prtd = 0;
int i, ret=0;
+ 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);
+
/* Ensure period size is multiple of minimum DMA step size */
ret = snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, DMA_STEP_SIZE_MIN);
diff --git a/sound/soc/tegra/tegra_soc_wm8903.c b/sound/soc/tegra/tegra_soc_wm8903.c
index b7ab17e37d66..8498120cfceb 100644
--- a/sound/soc/tegra/tegra_soc_wm8903.c
+++ b/sound/soc/tegra/tegra_soc_wm8903.c
@@ -545,11 +545,6 @@ 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-spdif", "Tegra Spdif",
- &tegra_spdif_dai, &tegra_generic_codec_dai[0],
- &tegra_spdif_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],
@@ -557,13 +552,17 @@ static struct snd_soc_dai_link tegra_soc_dai[] = {
#else
/* FIXME: enabled once these device are enumerated
TEGRA_CREATE_SOC_DAI_LINK("Tegra-generic-0", "Tegra BB Voice",
- &tegra_i2s_dai[1], &tegra_generic_codec_dai[1],
- &tegra_voice_ops),
+ &tegra_i2s_dai[2], &tegra_generic_codec_dai[0],
+ &tegra_voice_ops), */
TEGRA_CREATE_SOC_DAI_LINK("Tegra-generic-1", "Tegra BT Voice",
&tegra_i2s_dai[2], &tegra_generic_codec_dai[2],
&tegra_voice_ops),
-*/
+
#endif
+
+ TEGRA_CREATE_SOC_DAI_LINK("Tegra-spdif", "Tegra Spdif",
+ &tegra_spdif_dai, &tegra_generic_codec_dai[0],
+ &tegra_spdif_ops),
};
static struct tegra_audio_data audio_data = {