linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b29396@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] ASoC: mxs-saif: set a base clock rate for EXTMASTER mode work
Date: Fri, 20 Jul 2012 17:20:25 +0800	[thread overview]
Message-ID: <1342776027-31758-3-git-send-email-b29396@freescale.com> (raw)
In-Reply-To: <1342776027-31758-1-git-send-email-b29396@freescale.com>

From: Dong Aisheng <dong.aisheng@linaro.org>

Set an initial clock rate for the saif internal logic to work
properly. This is important when working in EXTMASTER mode that
uses the other saif's BITCLK&LRCLK but it still needs a basic
clock which should be fast enough for the internal logic.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
 sound/soc/mxs/mxs-saif.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index fdbb36a..b303071 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -427,8 +427,22 @@ static int mxs_saif_hw_params(struct snd_pcm_substream *substream,
 
 	/* prepare clk in hw_param, enable in trigger */
 	clk_prepare(saif->clk);
-	if (saif != master_saif)
+	if (saif != master_saif) {
+		/*
+		* Set an initial clock rate for the saif internal logic to work
+		* properly. This is important when working in EXTMASTER mode
+		* that uses the other saif's BITCLK&LRCLK but it still needs a
+		* basic clock which should be fast enough for the internal
+		* logic.
+		*/
+		clk_enable(saif->clk);
+		ret = clk_set_rate(saif->clk, 24000000);
+		clk_disable(saif->clk);
+		if (ret)
+			return ret;
+
 		clk_prepare(master_saif->clk);
+	}
 
 	scr = __raw_readl(saif->base + SAIF_CTRL);
 
-- 
1.7.0.4

  parent reply	other threads:[~2012-07-20  9:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20  9:20 [PATCH 0/4] ASoC: fix saif record unwork issue Dong Aisheng
2012-07-20  9:20 ` [PATCH 1/4] ASoC: mxs-saif: fix clock prepare and enable unbalance issue Dong Aisheng
2012-07-21  7:03   ` [alsa-devel] " Shawn Guo
2012-07-24 19:18   ` Mark Brown
2016-01-16 16:24   ` Måns Rullgård
2012-07-20  9:20 ` Dong Aisheng [this message]
2012-07-21  7:20   ` [alsa-devel] [PATCH 2/4] ASoC: mxs-saif: set a base clock rate for EXTMASTER mode work Shawn Guo
2012-07-24 19:18   ` Mark Brown
2012-07-20  9:20 ` [PATCH 3/4] ASoC: sgtl5000: remove unneeded snd_soc_dapm_new_widgets in probe Dong Aisheng
2012-07-21  8:37   ` [alsa-devel] " Shawn Guo
2012-07-24 19:20   ` Mark Brown
2012-07-20  9:20 ` [PATCH 4/4] ARM: mx28evk: add missed clkmux select for saif Dong Aisheng
2012-07-21  7:40   ` [alsa-devel] " Shawn Guo
2012-07-23  2:36     ` Dong Aisheng
2012-07-28  8:25       ` Shawn Guo
2012-08-01  2:47         ` Dong Aisheng
2012-07-24 12:46 ` [alsa-devel] [PATCH 0/4] ASoC: fix saif record unwork issue Lauri Hintsala
2012-07-24 19:21   ` Mark Brown
2012-07-25  5:26     ` Lauri Hintsala
2012-07-25  6:44       ` Dong Aisheng
2012-07-25  8:55         ` Lauri Hintsala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342776027-31758-3-git-send-email-b29396@freescale.com \
    --to=b29396@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).