summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorVinod Subbarayalu <vsubbarayalu@nvidia.com>2013-08-01 16:03:53 -0700
committerRiham Haidar <rhaidar@nvidia.com>2013-08-14 18:57:26 -0700
commitc594b04883ec9528114188c70bacdbcf4df23380 (patch)
tree8a337eba62d339b63a07e09bf92c0c9b230e3254 /sound
parent6d41daab2b4d6ede2e16a0b0354631e8a6648d8b (diff)
audio:Support Tfa9887 at different samplerate
Configure Tfa9887 at 16k for voip+nvoice usecase. Add missing copyright info. Change-Id: I080e874510255f1b2a4bf7d8045ef8fa6e2faadc Signed-off-by: Vinod Subbarayalu <vsubbarayalu@nvidia.com> Reviewed-on: http://git-master/r/257042 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_rt5640.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index bd5d6b1d2f62..61b1fc828768 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -2,7 +2,7 @@
* tegra_rt5640.c - Tegra machine ASoC driver for boards using ALC5640 codec.
*
* Author: Johnny Qiu <joqiu@nvidia.com>
- * Copyright (C) 2011-2012, NVIDIA, Inc.
+ * Copyright (C) 2011-2013, NVIDIA, Inc.
*
* Based on code copyright/by:
*
@@ -10,7 +10,7 @@
* Author: Graeme Gregory
* graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com
*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
@@ -100,7 +100,8 @@ static int tegra_rt5640_hw_params(struct snd_pcm_substream *substream,
struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(cpu_dai);
int srate, mclk, i2s_daifmt;
int err, rate;
- static unsigned initTfa = 0;
+ static unsigned int initTfa;
+ static int tfasrate;
srate = params_rate(params);
mclk = 256 * srate;
@@ -167,7 +168,13 @@ static int tegra_rt5640_hw_params(struct snd_pcm_substream *substream,
tegra_asoc_enable_clocks();
pr_info("INIT TFA\n");
Tfa9887_Init(srate);
+ tfasrate = srate;
tegra_asoc_disable_clocks();
+ } else if (initTfa > 1) {
+ if (srate != tfasrate) {
+ Tfa9887_setSampleRate(srate);
+ tfasrate = srate;
+ }
}
initTfa++;
}