summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorScottPeterson <speterson@nvidia.com>2011-10-21 15:38:32 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-10-27 15:09:28 -0700
commite121d8cc2635b4333794b8815f370dbb3218c8c1 (patch)
tree287e1a2bc89b8778d316631e2abd69c93bdbc3d5 /sound
parentaccf2b0e8cb96ac1cd9ea620081004c36673d761 (diff)
soc:tegra: Use correct codec BCLK
The tegra soc driver was using the mclk as the basis for programming the i2s clk instead of the setting that was part of the device data from the board file. Bug 890191 Change-Id: Id6cd797cc90f1906597e6bc151e68e3ec084cf4d Signed-off-by: ScottPeterson <speterson@nvidia.com> Change-Id: Id41c78e7e000989189179fd4687219b28b8d21e4 Reviewed-on: http://git-master/r/60044 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_soc_max98088.c4
-rw-r--r--sound/soc/tegra/tegra_soc_wm8753.c6
-rw-r--r--sound/soc/tegra/tegra_soc_wm8903.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/tegra/tegra_soc_max98088.c b/sound/soc/tegra/tegra_soc_max98088.c
index 4c74a5300514..e31e2213bcf8 100644
--- a/sound/soc/tegra/tegra_soc_max98088.c
+++ b/sound/soc/tegra/tegra_soc_max98088.c
@@ -72,6 +72,8 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+ struct tegra_i2s_info *info = cpu_dai->private_data;
+ struct tegra_audio_platform_data* i2s_pdata = info->pdata;
int sys_clk;
int err;
int dai_flag = SND_SOC_DAIFMT_NB_NF;
@@ -106,7 +108,7 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream,
/*FIXME: not sure this is the right way.
This should be samplerate times 256 or 128 based on codec need*/
- sys_clk = tegra_das_get_mclk_rate();
+ sys_clk = (unsigned int) i2s_pdata->dev_clk_rate;
err = snd_soc_dai_set_sysclk(codec_dai, 0, sys_clk, SND_SOC_CLOCK_IN);
if (err < 0) {
pr_err("codec_dai clock not set\n");
diff --git a/sound/soc/tegra/tegra_soc_wm8753.c b/sound/soc/tegra/tegra_soc_wm8753.c
index 137ef948f32b..f337877e759f 100644
--- a/sound/soc/tegra/tegra_soc_wm8753.c
+++ b/sound/soc/tegra/tegra_soc_wm8753.c
@@ -195,7 +195,7 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream,
return err;
}
- sys_clk = tegra_das_get_mclk_rate();
+ sys_clk = (unsigned int) i2s_pdata->dev_clk_rate;
err = snd_soc_dai_set_sysclk(codec_dai, 0, sys_clk, SND_SOC_CLOCK_IN);
if (err < 0) {
pr_err("codec_dai clock not set\n");
@@ -328,6 +328,8 @@ static int tegra_voice_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+ struct tegra_i2s_info *info = cpu_dai->private_data;
+ struct tegra_audio_platform_data* i2s_pdata = info->pdata;
int dai_flag = 0, sys_clk;
int err;
enum dac_dap_data_format data_fmt;
@@ -378,7 +380,7 @@ static int tegra_voice_hw_params(struct snd_pcm_substream *substream,
return err;
}
- sys_clk = tegra_das_get_mclk_rate();
+ sys_clk = (unsigned int) i2s_pdata->dev_clk_rate;
err = snd_soc_dai_set_sysclk(codec_dai, 0, sys_clk, SND_SOC_CLOCK_IN);
if (err < 0) {
pr_err("cpu_dai clock not set\n");
diff --git a/sound/soc/tegra/tegra_soc_wm8903.c b/sound/soc/tegra/tegra_soc_wm8903.c
index 05e6e71797b6..6927c4f2fda9 100644
--- a/sound/soc/tegra/tegra_soc_wm8903.c
+++ b/sound/soc/tegra/tegra_soc_wm8903.c
@@ -76,6 +76,7 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
struct snd_soc_codec *codec = codec_dai->codec;
struct tegra_i2s_info *info = cpu_dai->private_data;
+ struct tegra_audio_platform_data* i2s_pdata = info->pdata;
int dai_flag = 0, sys_clk;
int err;
enum dac_dap_data_format data_fmt;
@@ -94,6 +95,7 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream,
else
dai_flag |= SND_SOC_DAIFMT_I2S;
+
err = snd_soc_dai_set_fmt(codec_dai, dai_flag);
if (err < 0) {
pr_err("codec_dai fmt not set \n");
@@ -109,12 +111,14 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream,
/*FIXME: not sure this is the right way.
This should be samplerate times 256 or 128 based on codec need*/
sys_clk = tegra_das_get_mclk_rate();
+
err = snd_soc_dai_set_sysclk(codec_dai, 0, sys_clk, SND_SOC_CLOCK_IN);
if (err < 0) {
pr_err("codec_dai clock not set\n");
return err;
}
+ sys_clk = (unsigned int) i2s_pdata->dev_clk_rate;
err = snd_soc_dai_set_sysclk(cpu_dai, 0, sys_clk, SND_SOC_CLOCK_IN);
if (err < 0) {
pr_err("cpu_dai clock not set\n");