diff options
author | Sumit Bhattacharya <sumitb@nvidia.com> | 2011-11-05 03:21:50 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:53 -0800 |
commit | 3500dc25c7eef0e45fd75b49d910c0240e536001 (patch) | |
tree | f69488578ee7338ff7dce977861222598885b66f /sound | |
parent | 138456fa49d6ff15f35c850bfcb7ea658f512358 (diff) |
ASoC: Tegra wm8903 machine: Use DSP mode for mono on Tegra20
Use DSP mode for playback and capture on Tegra20 platforms.
Bug 872652
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Change-Id: Iddf6d3b5dc83d509ddf857a8c3b0bb0ec13d9879
Reviewed-on: http://git-master/r/62512
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: R48dbdcdad6191f354a63c4a01fb33668c43ac28a
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_wm8903.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 54036f2f0bc6..a260ac85d6f2 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c @@ -74,7 +74,7 @@ static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream, struct snd_soc_codec *codec = rtd->codec; struct snd_soc_card *card = codec->card; struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card); - int srate, mclk; + int srate, mclk, i2s_daifmt; int err; srate = params_rate(params); @@ -98,19 +98,24 @@ static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream, return err; } - err = snd_soc_dai_set_fmt(codec_dai, - SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBS_CFS); + i2s_daifmt = SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS; + + /* Use DSP mode for mono on Tegra20 */ + if ((params_channels(params) != 2) && + (machine_is_ventana() || machine_is_harmony() || + machine_is_kaen() || machine_is_aebl())) + i2s_daifmt |= SND_SOC_DAIFMT_DSP_A; + else + i2s_daifmt |= SND_SOC_DAIFMT_I2S; + + err = snd_soc_dai_set_fmt(codec_dai, i2s_daifmt); if (err < 0) { dev_err(card->dev, "codec_dai fmt not set\n"); return err; } - err = snd_soc_dai_set_fmt(cpu_dai, - SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBS_CFS); + err = snd_soc_dai_set_fmt(cpu_dai, i2s_daifmt); if (err < 0) { dev_err(card->dev, "cpu_dai fmt not set\n"); return err; |