All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFT] ASoC: max98926: Fix blr_clk_ratio calculation
@ 2016-02-17  0:46 Axel Lin
  2016-02-17  7:39 ` anish kumar
  2016-02-17 19:13 ` Applied "ASoC: max98926: Fix blr_clk_ratio calculation" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2016-02-17  0:46 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood, anish kumar

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

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

* Re: [PATCH RFT] ASoC: max98926: Fix blr_clk_ratio calculation
  2016-02-17  0:46 [PATCH RFT] ASoC: max98926: Fix blr_clk_ratio calculation Axel Lin
@ 2016-02-17  7:39 ` anish kumar
  2016-02-17 19:13 ` Applied "ASoC: max98926: Fix blr_clk_ratio calculation" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: anish kumar @ 2016-02-17  7:39 UTC (permalink / raw)
  To: Axel Lin; +Cc: Linux-ALSA, Mark Brown, Liam Girdwood

Looks good to me. Thanks.

Acked-by: anish kumar<yesanishhere@gmail.com>

On Tue, Feb 16, 2016 at 4:46 PM, Axel Lin <axel.lin@ingics.com> wrote:
> 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
>
>
>

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

* Applied "ASoC: max98926: Fix blr_clk_ratio calculation" to the asoc tree
  2016-02-17  0:46 [PATCH RFT] ASoC: max98926: Fix blr_clk_ratio calculation Axel Lin
  2016-02-17  7:39 ` anish kumar
@ 2016-02-17 19:13 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2016-02-17 19:13 UTC (permalink / raw)
  To: Axel Lin, anish kumar, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: max98926: Fix blr_clk_ratio calculation

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From cffee535f0b09ab0801cbec01a8ae81595aa99bc Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Wed, 17 Feb 2016 08:46:07 +0800
Subject: [PATCH] ASoC: max98926: Fix blr_clk_ratio calculation

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

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: anish kumar <yesanishhere@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 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 66884ebdf2bb..5245e107de30 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.7.0

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

end of thread, other threads:[~2016-02-17 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-17  0:46 [PATCH RFT] ASoC: max98926: Fix blr_clk_ratio calculation Axel Lin
2016-02-17  7:39 ` anish kumar
2016-02-17 19:13 ` Applied "ASoC: max98926: Fix blr_clk_ratio calculation" to the asoc tree 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.