* [PATCH] ASoC: Pandora: Pass SRG input clock frequency to the OMAP McBSP DAI
@ 2009-11-09 6:44 Jarkko Nikula
2009-11-09 13:19 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Jarkko Nikula @ 2009-11-09 6:44 UTC (permalink / raw)
To: alsa-devel; +Cc: Mark Brown, Grazvydas Ignotas
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>
---
sound/soc/omap/omap3pandora.c | 24 ++++++++++--------------
1 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index ad219aa..cace5f1 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -40,9 +40,12 @@
#define PREFIX "ASoC omap3pandora: "
-static int omap3pandora_cmn_hw_params(struct snd_soc_dai *codec_dai,
- struct snd_soc_dai *cpu_dai, unsigned int fmt)
+static int omap3pandora_cmn_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params, unsigned int fmt)
{
+ 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;
int ret;
/* Set codec DAI configuration */
@@ -68,8 +71,9 @@ static int omap3pandora_cmn_hw_params(struct snd_soc_dai *codec_dai,
}
/* Set McBSP clock to external */
- ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_EXT, 0,
- SND_SOC_CLOCK_IN);
+ ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_EXT,
+ 256 * params_rate(params),
+ SND_SOC_CLOCK_IN);
if (ret < 0) {
pr_err(PREFIX "can't set cpu system clock\n");
return ret;
@@ -87,11 +91,7 @@ static int omap3pandora_cmn_hw_params(struct snd_soc_dai *codec_dai,
static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- 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;
-
- return omap3pandora_cmn_hw_params(codec_dai, cpu_dai,
+ return omap3pandora_cmn_hw_params(substream, params,
SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_IB_NF |
SND_SOC_DAIFMT_CBS_CFS);
@@ -100,11 +100,7 @@ static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream,
static int omap3pandora_in_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- 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;
-
- return omap3pandora_cmn_hw_params(codec_dai, cpu_dai,
+ return omap3pandora_cmn_hw_params(substream, params,
SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS);
--
1.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: Pandora: Pass SRG input clock frequency to the OMAP McBSP DAI
2009-11-09 6:44 [PATCH] ASoC: Pandora: Pass SRG input clock frequency to the OMAP McBSP DAI Jarkko Nikula
@ 2009-11-09 13:19 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2009-11-09 13:19 UTC (permalink / raw)
To: Jarkko Nikula; +Cc: alsa-devel, Grazvydas Ignotas
On Mon, Nov 09, 2009 at 08:44:32AM +0200, Jarkko Nikula wrote:
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-09 13:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-09 6:44 [PATCH] ASoC: Pandora: Pass SRG input clock frequency to the OMAP McBSP DAI Jarkko Nikula
2009-11-09 13:19 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.