aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorJarkko Nikula <jhnikula@gmail.com>2009-11-09 01:44:32 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-11-09 08:18:34 -0500
commit9e5d86fe6a401f7957f6ea02ee300db0f6c03d03 (patch)
tree6c43dc04a233ef8cc573123332b44e926913b526 /sound/soc
parentc939e5c82142978d9d534aca34187a8489fd13f3 (diff)
ASoC: Pandora: Pass SRG input clock frequency to the OMAP McBSP DAI
Upcoming change to omap-mcbsp.c require that machine drivers using OMAP as a DAI master to pass sample rate generator input clock frequency to the omap-mcbsp.c DAI driver. Pandora is using 256*Fs output from the TWL4030 codec as an input clock to the McBSP sample rate generator. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Tested-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/omap/omap3pandora.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index ad219aaf7cb8..cace5f13792d 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -40,9 +40,12 @@
40 40
41#define PREFIX "ASoC omap3pandora: " 41#define PREFIX "ASoC omap3pandora: "
42 42
43static int omap3pandora_cmn_hw_params(struct snd_soc_dai *codec_dai, 43static int omap3pandora_cmn_hw_params(struct snd_pcm_substream *substream,
44 struct snd_soc_dai *cpu_dai, unsigned int fmt) 44 struct snd_pcm_hw_params *params, unsigned int fmt)
45{ 45{
46 struct snd_soc_pcm_runtime *rtd = substream->private_data;
47 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
48 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
46 int ret; 49 int ret;
47 50
48 /* Set codec DAI configuration */ 51 /* Set codec DAI configuration */
@@ -68,8 +71,9 @@ static int omap3pandora_cmn_hw_params(struct snd_soc_dai *codec_dai,
68 } 71 }
69 72
70 /* Set McBSP clock to external */ 73 /* Set McBSP clock to external */
71 ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_EXT, 0, 74 ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_EXT,
72 SND_SOC_CLOCK_IN); 75 256 * params_rate(params),
76 SND_SOC_CLOCK_IN);
73 if (ret < 0) { 77 if (ret < 0) {
74 pr_err(PREFIX "can't set cpu system clock\n"); 78 pr_err(PREFIX "can't set cpu system clock\n");
75 return ret; 79 return ret;
@@ -87,11 +91,7 @@ static int omap3pandora_cmn_hw_params(struct snd_soc_dai *codec_dai,
87static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream, 91static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream,
88 struct snd_pcm_hw_params *params) 92 struct snd_pcm_hw_params *params)
89{ 93{
90 struct snd_soc_pcm_runtime *rtd = substream->private_data; 94 return omap3pandora_cmn_hw_params(substream, params,
91 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
92 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
93
94 return omap3pandora_cmn_hw_params(codec_dai, cpu_dai,
95 SND_SOC_DAIFMT_I2S | 95 SND_SOC_DAIFMT_I2S |
96 SND_SOC_DAIFMT_IB_NF | 96 SND_SOC_DAIFMT_IB_NF |
97 SND_SOC_DAIFMT_CBS_CFS); 97 SND_SOC_DAIFMT_CBS_CFS);
@@ -100,11 +100,7 @@ static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream,
100static int omap3pandora_in_hw_params(struct snd_pcm_substream *substream, 100static int omap3pandora_in_hw_params(struct snd_pcm_substream *substream,
101 struct snd_pcm_hw_params *params) 101 struct snd_pcm_hw_params *params)
102{ 102{
103 struct snd_soc_pcm_runtime *rtd = substream->private_data; 103 return omap3pandora_cmn_hw_params(substream, params,
104 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
105 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
106
107 return omap3pandora_cmn_hw_params(codec_dai, cpu_dai,
108 SND_SOC_DAIFMT_I2S | 104 SND_SOC_DAIFMT_I2S |
109 SND_SOC_DAIFMT_NB_NF | 105 SND_SOC_DAIFMT_NB_NF |
110 SND_SOC_DAIFMT_CBS_CFS); 106 SND_SOC_DAIFMT_CBS_CFS);