* [PATCH] ASoC: fsl_sai: Move the global registers setting to _dai_probe()
@ 2013-12-25 3:20 Xiubo Li
2013-12-30 12:01 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Xiubo Li @ 2013-12-25 3:20 UTC (permalink / raw)
To: broonie
Cc: alsa-devel, lgirdwood, tiwai, linux-kernel, timur, perex,
shawn.guo, linuxppc-dev, b47053
Because we cannot make sure which one of _dai_fmt() and _dai_sysclk()
will be firstly called. So move the RCSR/TCSR and TCR1/RCR1's
initialization to _dai_probe(), and this can make sure that before any
of {T,R}CR{1~5} register to be set the RCSR/TCSR's RE/TE bit has been
cleared for the hareware limitation.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
sound/soc/fsl/fsl_sai.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index b72132f..596aabb 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -100,11 +100,6 @@ static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
if (ret)
return ret;
- sai_writel(sai, 0x0, sai->base + FSL_SAI_RCSR);
- sai_writel(sai, 0x0, sai->base + FSL_SAI_TCSR);
- sai_writel(sai, FSL_SAI_MAXBURST_TX * 2, sai->base + FSL_SAI_TCR1);
- sai_writel(sai, FSL_SAI_MAXBURST_RX - 1, sai->base + FSL_SAI_RCR1);
-
ret = fsl_sai_set_dai_sysclk_tr(cpu_dai, clk_id, freq,
FSL_FMT_TRANSMITTER);
if (ret) {
@@ -351,6 +346,18 @@ static const struct snd_soc_dai_ops fsl_sai_pcm_dai_ops = {
static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
{
struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev);
+ int ret;
+
+ ret = clk_prepare_enable(sai->clk);
+ if (ret)
+ return ret;
+
+ sai_writel(sai, 0x0, sai->base + FSL_SAI_RCSR);
+ sai_writel(sai, 0x0, sai->base + FSL_SAI_TCSR);
+ sai_writel(sai, FSL_SAI_MAXBURST_TX * 2, sai->base + FSL_SAI_TCR1);
+ sai_writel(sai, FSL_SAI_MAXBURST_RX - 1, sai->base + FSL_SAI_RCR1);
+
+ clk_disable_unprepare(sai->clk);
snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx,
&sai->dma_params_rx);
--
1.8.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: fsl_sai: Move the global registers setting to _dai_probe()
2013-12-25 3:20 [PATCH] ASoC: fsl_sai: Move the global registers setting to _dai_probe() Xiubo Li
@ 2013-12-30 12:01 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-12-30 12:01 UTC (permalink / raw)
To: Xiubo Li
Cc: alsa-devel, lgirdwood, tiwai, linux-kernel, timur, perex,
shawn.guo, linuxppc-dev, b47053
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
On Wed, Dec 25, 2013 at 11:20:14AM +0800, Xiubo Li wrote:
> Because we cannot make sure which one of _dai_fmt() and _dai_sysclk()
> will be firstly called. So move the RCSR/TCSR and TCR1/RCR1's
> initialization to _dai_probe(), and this can make sure that before any
> of {T,R}CR{1~5} register to be set the RCSR/TCSR's RE/TE bit has been
> cleared for the hareware limitation.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-30 12:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-25 3:20 [PATCH] ASoC: fsl_sai: Move the global registers setting to _dai_probe() Xiubo Li
2013-12-30 12:01 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).