diff options
author | Viswanath L <viswanathl@nvidia.com> | 2014-06-02 18:08:14 +0530 |
---|---|---|
committer | Gabby Lee <galee@nvidia.com> | 2014-06-08 20:54:17 -0700 |
commit | 2bd68aac9e4b543b531fd1b1cd60c5e23422e5d0 (patch) | |
tree | a8d6047c838d87e34304ea9c035394b1669c9e02 /sound | |
parent | f75eb820402730e51af27c5fd3a81b0e7a14cb6d (diff) |
ASoC:Tegra: DAM and AHUB configuration for BT-SCO
BT-SCO playout from application is routed as below:
- directly to I2S when there is no call
- via DAM when there is an active call
DAM channel 1 (used above) is configured correctly
Bug 1506177
Change-Id: I608be794bd70a85a0978a73cfc93a4a48b69abd0
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/417751
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lei Fan <leif@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gabby Lee <galee@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_rt5640.c | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c index 065681bdec3f..eba3694038c3 100644 --- a/sound/soc/tegra/tegra_rt5640.c +++ b/sound/soc/tegra/tegra_rt5640.c @@ -485,9 +485,22 @@ static int tegra_bt_sco_hw_params(struct snd_pcm_substream *substream, struct snd_soc_card *card = rtd->card; struct tegra_rt5640 *machine = snd_soc_card_get_drvdata(card); struct tegra_asoc_platform_data *pdata = machine->pdata; - int srate, mclk, min_mclk, i2s_daifmt; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(cpu_dai); + int srate, mclk, min_mclk, sample_size, i2s_daifmt; int err; + switch (params_format(params)) { + case SNDRV_PCM_FORMAT_S16_LE: + sample_size = 16; + break; + case SNDRV_PCM_FORMAT_S24_LE: + sample_size = 24; + break; + default: + return -EINVAL; + } + srate = params_rate(params); switch (srate) { case 11025: @@ -551,6 +564,11 @@ static int tegra_bt_sco_hw_params(struct snd_pcm_substream *substream, return err; } + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && i2s->is_dam_used) + tegra_bt_set_dam_cif(i2s->dam_ifc, + srate, params_channels(params), sample_size, + 0, 0, 0, 0); + return 0; } @@ -794,20 +812,26 @@ static int tegra_bt_startup(struct snd_pcm_substream *substream) i2s->dam_ch_refcount++; tegra30_dam_enable_clock(i2s->dam_ifc); - tegra30_ahub_set_rx_cif_source( - TEGRA30_AHUB_RXCIF_DAM0_RX1 + - (i2s->dam_ifc*2), i2s->txcif); - /* - * make the dam tx to i2s rx connection - * if this is the only client - * using i2s for playback - */ - if (i2s->playback_ref_count == 1) + if (machine->is_call_mode) { tegra30_ahub_set_rx_cif_source( - TEGRA30_AHUB_RXCIF_I2S0_RX0 + - i2s->id, - TEGRA30_AHUB_TXCIF_DAM0_TX0 + - i2s->dam_ifc); + TEGRA30_AHUB_RXCIF_DAM0_RX1 + + (i2s->dam_ifc*2), i2s->txcif); + /* + * make the dam tx to i2s rx connection + * if this is the only client + * using i2s for playback + */ + if (i2s->playback_ref_count == 1) + tegra30_ahub_set_rx_cif_source( + TEGRA30_AHUB_RXCIF_I2S0_RX0 + + i2s->id, + TEGRA30_AHUB_TXCIF_DAM0_TX0 + + i2s->dam_ifc); + } else { + tegra30_ahub_set_rx_cif_source( + TEGRA30_AHUB_RXCIF_I2S0_RX0 + i2s->id, + i2s->txcif); + } /* enable the dam*/ tegra30_dam_enable(i2s->dam_ifc, TEGRA30_DAM_ENABLE, |