summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorScott Peterson <speterson@nvidia.com>2013-01-17 14:54:16 -0800
committerMandar Padmawar <mpadmawar@nvidia.com>2013-01-22 06:26:00 -0800
commit980b950cba55f9c12e5d7a8da79eec0115787da9 (patch)
tree3d1ae24e47a396adca538beb2cb6b1db343bc657 /sound
parent2cecff0488c9d485d23124d7b7ad0891d2d3f8c2 (diff)
asoc: tegra: Support Voice + Media
Add support for concurent voice and media streams without using the DAM when the audio codec supports two I2S interfaces. Bug 1213272 Change-Id: Ie39d048a27003bc69ab40ee4d3087d15894f168f Signed-off-by: Scott Peterson <speterson@nvidia.com> Reviewed-on: http://git-master/r/192202 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rahul Mittal <rmittal@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra30_i2s.c7
-rw-r--r--sound/soc/tegra/tegra_cs42l73.c20
2 files changed, 17 insertions, 10 deletions
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 9ad1bb641710..e05b55ac36fe 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -1215,9 +1215,10 @@ int tegra30_make_voice_call_connections(struct codec_config *codec_info,
bb_info->rate, bb_info->bitsize, bb_info->bit_clk);
if (uses_voice_codec) {
- /* The following two lines are a hack */
- tegra30_ahub_unset_rx_cif_source(TEGRA30_AHUB_RXCIF_APBIF_RX0);
- tegra30_ahub_unset_rx_cif_source(TEGRA30_AHUB_RXCIF_I2S0_RX0+1);
+ tegra30_ahub_unset_rx_cif_source(TEGRA30_AHUB_RXCIF_APBIF_RX0 +
+ codec_info->i2s_id);
+ tegra30_ahub_unset_rx_cif_source(TEGRA30_AHUB_RXCIF_APBIF_RX0 +
+ bb_info->i2s_id);
tegra30_ahub_set_rx_cif_source(TEGRA30_AHUB_RXCIF_I2S0_RX0 +
bb_info->i2s_id, TEGRA30_AHUB_TXCIF_I2S0_TX0 +
diff --git a/sound/soc/tegra/tegra_cs42l73.c b/sound/soc/tegra/tegra_cs42l73.c
index 802303a6338a..2b71cdd9c00c 100644
--- a/sound/soc/tegra/tegra_cs42l73.c
+++ b/sound/soc/tegra/tegra_cs42l73.c
@@ -506,7 +506,8 @@ static int tegra_cs42l73_startup(struct snd_pcm_substream *substream)
/*dam configuration*/
if (!i2s->dam_ch_refcount)
i2s->dam_ifc = tegra30_dam_allocate_controller();
-
+ if (i2s->dam_ifc < 0)
+ return i2s->dam_ifc;
tegra30_dam_allocate_channel(i2s->dam_ifc, TEGRA30_DAM_CHIN1);
i2s->dam_ch_refcount++;
tegra30_dam_enable_clock(i2s->dam_ifc);
@@ -544,6 +545,10 @@ static int tegra_cs42l73_startup(struct snd_pcm_substream *substream)
/* allocate a dam for voice call recording */
i2s->call_record_dam_ifc = tegra30_dam_allocate_controller();
+
+ if (i2s->call_record_dam_ifc < 0)
+ return i2s->call_record_dam_ifc;
+
tegra30_dam_allocate_channel(i2s->call_record_dam_ifc,
TEGRA30_DAM_CHIN0_SRC);
tegra30_dam_allocate_channel(i2s->call_record_dam_ifc,
@@ -751,7 +756,7 @@ static void tegra_voice_call_shutdown(struct snd_pcm_substream *substream)
machine->codec_info[VOICE_CODEC].rate = 0;
machine->codec_info[VOICE_CODEC].channels = 0;
#endif
-
+ machine->is_device_bt = 0;
return;
}
@@ -818,7 +823,7 @@ static void tegra_bt_voice_call_shutdown(struct snd_pcm_substream *substream)
machine->codec_info[BT_SCO].channels = 0;
#endif
- return;
+ machine->is_device_bt = 0;
}
static struct snd_soc_ops tegra_cs42l73_ops = {
@@ -1057,13 +1062,14 @@ static int tegra_cs42l73_init(struct snd_soc_pcm_runtime *rtd)
int ret;
#ifndef CONFIG_ARCH_TEGRA_2x_SOC
-
- if (machine->codec_info[BASEBAND].i2s_id != -1) {
- if (i2s->id == machine->codec_info[BT_SCO].i2s_id)
+ if (machine->codec_info[BASEBAND].i2s_id != -1)
i2s->is_dam_used = true;
- }
#endif
+ if ((i2s->id == machine->codec_info[HIFI_CODEC].i2s_id) &&
+ (i2s->id != machine->codec_info[VOICE_CODEC].i2s_id))
+ i2s->is_dam_used = false;
+
if (machine->init_done)
return 0;