All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsi: fsi_set_master_clk() was called from fsi_hw_xxx() only
@ 2012-10-29  7:37 Kuninori Morimoto
  2012-10-29 18:47 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2012-10-29  7:37 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto

Current FSI driver is using fsi_set_master_clk() if it needs system clock.
But this function was called from
fsi_hw_shutdown()/fsi_dai_trigger()/fsi_resume() without a sense of unity.
Because of this, sound playback after suspend failed sometimes.
To keep consistency, fsi_master_clk() was called from
fsi_hw_start/stop() only now.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/fsi.c |   23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index a33d483..e97501b 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1364,12 +1364,17 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
 	/* fifo init */
 	fsi_fifo_init(fsi, io, dev);
 
+	/* start master clock */
+	if (fsi_is_clk_master(fsi))
+		fsi_set_master_clk(dev, fsi, fsi->rate, 1);
+
 	return 0;
 }
 
 static void fsi_hw_shutdown(struct fsi_priv *fsi,
 			    struct device *dev)
 {
+	/* stop master clock */
 	if (fsi_is_clk_master(fsi))
 		fsi_set_master_clk(dev, fsi, fsi->rate, 0);
 }
@@ -1492,19 +1497,11 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream,
 			     struct snd_soc_dai *dai)
 {
 	struct fsi_priv *fsi = fsi_get_priv(substream);
-	long rate = params_rate(params);
-	int ret;
-
-	if (!fsi_is_clk_master(fsi))
-		return 0;
-
-	ret = fsi_set_master_clk(dai->dev, fsi, rate, 1);
-	if (ret < 0)
-		return ret;
 
-	fsi->rate = rate;
+	if (fsi_is_clk_master(fsi))
+		fsi->rate = params_rate(params);
 
-	return ret;
+	return 0;
 }
 
 static const struct snd_soc_dai_ops fsi_dai_ops = {
@@ -1806,10 +1803,6 @@ static void __fsi_resume(struct fsi_priv *fsi,
 		return;
 
 	fsi_hw_startup(fsi, io, dev);
-
-	if (fsi_is_clk_master(fsi) && fsi->rate)
-		fsi_set_master_clk(dev, fsi, fsi->rate, 1);
-
 	fsi_stream_start(fsi, io);
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: fsi: fsi_set_master_clk() was called from fsi_hw_xxx() only
  2012-10-29  7:37 [PATCH] ASoC: fsi: fsi_set_master_clk() was called from fsi_hw_xxx() only Kuninori Morimoto
@ 2012-10-29 18:47 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-10-29 18:47 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto


[-- Attachment #1.1: Type: text/plain, Size: 429 bytes --]

On Mon, Oct 29, 2012 at 12:37:22AM -0700, Kuninori Morimoto wrote:
> Current FSI driver is using fsi_set_master_clk() if it needs system clock.
> But this function was called from
> fsi_hw_shutdown()/fsi_dai_trigger()/fsi_resume() without a sense of unity.
> Because of this, sound playback after suspend failed sometimes.
> To keep consistency, fsi_master_clk() was called from
> fsi_hw_start/stop() only now.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-29 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29  7:37 [PATCH] ASoC: fsi: fsi_set_master_clk() was called from fsi_hw_xxx() only Kuninori Morimoto
2012-10-29 18:47 ` 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.