summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNikesh Oswal <noswal@nvidia.com>2012-02-12 22:39:43 -0800
committerLokesh Pathak <lpathak@nvidia.com>2012-02-23 05:09:29 -0800
commitbdc6497c13b0cc41acbfbecf247501f0c3330aba (patch)
tree6680f4067e432ac03c66099b5feccdc876e21a0f /sound
parentd5f4cd89d4c6b15f704f4df4cf5024715e1e673a (diff)
asoc: tegra: aic326x machine: configure codec as master for voice call
Change-Id: I970ab858399113e4ea0d079779a2cb368af90850 Signed-off-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-on: http://git-master/r/84539 Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_aic326x.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/sound/soc/tegra/tegra_aic326x.c b/sound/soc/tegra/tegra_aic326x.c
index f9a925754ca6..f751ee76fd99 100644
--- a/sound/soc/tegra/tegra_aic326x.c
+++ b/sound/soc/tegra/tegra_aic326x.c
@@ -520,14 +520,13 @@ static int tegra_aic326x_voice_call_hw_params(
struct snd_soc_card *card = codec->card;
struct tegra_aic326x *machine = snd_soc_card_get_drvdata(card);
int srate, mclk;
- int err;
+ int err, pcmdiv, vxclkdiv;;
srate = params_rate(params);
mclk = tegra_aic326x_get_mclk(srate);
if (mclk < 0)
return mclk;
-
err = tegra_asoc_utils_set_rate(&machine->util_data, srate, mclk);
if (err < 0) {
if (!(machine->util_data.set_mclk % mclk))
@@ -541,9 +540,9 @@ static int tegra_aic326x_voice_call_hw_params(
tegra_asoc_utils_lock_clk_rate(&machine->util_data, 1);
err = snd_soc_dai_set_fmt(codec_dai,
- SND_SOC_DAIFMT_DSP_B |
+ SND_SOC_DAIFMT_DSP_A |
SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS);
+ SND_SOC_DAIFMT_CBM_CFM);
if (err < 0) {
dev_err(card->dev, "codec_dai fmt not set\n");
return err;
@@ -556,6 +555,24 @@ static int tegra_aic326x_voice_call_hw_params(
return err;
}
+ if (params_rate(params) == 8000) {
+ /* Change these Settings for 8KHz*/
+ pcmdiv = 1;
+ /* BB expecting 2048Khz bclk */
+ vxclkdiv = 27;
+ } else if (params_rate(params) == 16000) {
+ pcmdiv = 1;
+ /* BB expecting 2048Khz bclk */
+ vxclkdiv = 27;
+ } else {
+ dev_err(card->dev, "codec_dai unsupported voice rate\n");
+ return -EINVAL;
+ }
+
+ //snd_soc_dai_set_clkdiv(codec_dai, ASI2_BCLK_N, vxclkdiv);
+ //snd_soc_dai_set_clkdiv(codec_dai, ASI2_WCLK_N, pcmdiv);
+
+
#ifndef CONFIG_ARCH_TEGRA_2x_SOC
/* codec configuration */
machine->codec_info[HIFI_CODEC].rate = params_rate(params);
@@ -1045,6 +1062,7 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev)
tegra_aic326x_i2s_dai_name[machine->codec_info[BT_SCO].i2s_id];
#endif
+
#ifdef CONFIG_SWITCH
/* Add h2w switch class support */
ret = switch_dev_register(&aic326x_wired_switch_dev);