All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	anish kumar <yesanishhere@gmail.com>
Subject: [PATCH RFT] ASoC: max98926: Fix blr_clk_ratio calculation
Date: Wed, 17 Feb 2016 08:46:07 +0800	[thread overview]
Message-ID: <1455669967.6195.1.camel@ingics.com> (raw)

Current code calculates blr_clk_ratio before setting max98926->ch_size, fix
it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Anish,
I don't have this h/w, please review and test this patch.

thanks,
Axel

 sound/soc/codecs/max98926.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/max98926.c b/sound/soc/codecs/max98926.c
index 66884ebd..5245e10 100644
--- a/sound/soc/codecs/max98926.c
+++ b/sound/soc/codecs/max98926.c
@@ -383,8 +383,7 @@ static int max98926_dai_hw_params(struct snd_pcm_substream *substream,
 	int rate = params_rate(params), i;
 	struct snd_soc_codec *codec = dai->codec;
 	struct max98926_priv *max98926 = snd_soc_codec_get_drvdata(codec);
-	/* BCLK/LRCLK ratio calculation */
-	int blr_clk_ratio = params_channels(params) * max98926->ch_size;
+	int blr_clk_ratio;
 
 	switch (params_format(params)) {
 	case SNDRV_PCM_FORMAT_S16_LE:
@@ -414,6 +413,9 @@ static int max98926_dai_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
+	/* BCLK/LRCLK ratio calculation */
+	blr_clk_ratio = params_channels(params) * max98926->ch_size;
+
 	switch (blr_clk_ratio) {
 	case 32:
 		regmap_update_bits(max98926->regmap,
-- 
2.1.4

             reply	other threads:[~2016-02-17  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17  0:46 Axel Lin [this message]
2016-02-17  7:39 ` [PATCH RFT] ASoC: max98926: Fix blr_clk_ratio calculation anish kumar
2016-02-17 19:13 ` Applied "ASoC: max98926: Fix blr_clk_ratio calculation" to the asoc tree Mark Brown

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=1455669967.6195.1.camel@ingics.com \
    --to=axel.lin@ingics.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=yesanishhere@gmail.com \
    /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 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.