Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1251269 > unrolled thread

[PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers

Started byJiada Wang <jiada_wang@mentor.com>
First post2015-10-20 04:50 +0200
Last post2015-10-23 01:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers Jiada Wang <jiada_wang@mentor.com> - 2015-10-20 04:50 +0200
    Re: [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4  separate registers Charles Keepax <ckeepax@opensource.wolfsonmicro.com> - 2015-10-20 11:20 +0200
    Re: [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4  separate registers Mark Brown <broonie@kernel.org> - 2015-10-23 01:40 +0200

#1251269 — [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers

FromJiada Wang <jiada_wang@mentor.com>
Date2015-10-20 04:50 +0200
Subject[PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers
Message-ID<qlv9T-7bZ-1@gated-at.bofh.it>
As ALC2 register is volatile, declare it as one of ALC Coefficients
register together with other non-volatile registers will cause issue,
in case wm8962 has enter suspend mode, and cache_only flag is set,
any attempt to read from ALC2 will fail.

Instead of declaring one ALC Coefficients register which contains
ALC1 ~ ALC3 and Noise Gate, this patch declares 4 separate registers,
so that regmap can handle these registers differently based on their
classification.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
 sound/soc/codecs/wm8962.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index a3d7778..157530c 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -1782,8 +1782,11 @@ SND_SOC_BYTES("HD Bass Coefficients", WM8962_HDBASS_AI_1, 30),
 
 SOC_DOUBLE("ALC Switch", WM8962_ALC1, WM8962_ALCL_ENA_SHIFT,
 		WM8962_ALCR_ENA_SHIFT, 1, 0),
-SND_SOC_BYTES_MASK("ALC Coefficients", WM8962_ALC1, 4,
+SND_SOC_BYTES_MASK("ALC1", WM8962_ALC1, 1,
 		WM8962_ALCL_ENA_MASK | WM8962_ALCR_ENA_MASK),
+SND_SOC_BYTES("ALC2", WM8962_ALC2, 1),
+SND_SOC_BYTES("ALC3", WM8962_ALC3, 1),
+SND_SOC_BYTES("Noise Gate", WM8962_NOISE_GATE, 1),
 };
 
 static const struct snd_kcontrol_new wm8962_spk_mono_controls[] = {
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1251481 — Re: [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers

FromCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Date2015-10-20 11:20 +0200
SubjectRe: [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers
Message-ID<qlBfk-7L2-13@gated-at.bofh.it>
In reply to#1251269
On Tue, Oct 20, 2015 at 11:47:12AM +0900, Jiada Wang wrote:
> As ALC2 register is volatile, declare it as one of ALC Coefficients
> register together with other non-volatile registers will cause issue,
> in case wm8962 has enter suspend mode, and cache_only flag is set,
> any attempt to read from ALC2 will fail.
> 
> Instead of declaring one ALC Coefficients register which contains
> ALC1 ~ ALC3 and Noise Gate, this patch declares 4 separate registers,
> so that regmap can handle these registers differently based on their
> classification.
> 
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> ---
>  sound/soc/codecs/wm8962.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
> index a3d7778..157530c 100644
> --- a/sound/soc/codecs/wm8962.c
> +++ b/sound/soc/codecs/wm8962.c
> @@ -1782,8 +1782,11 @@ SND_SOC_BYTES("HD Bass Coefficients", WM8962_HDBASS_AI_1, 30),
>  
>  SOC_DOUBLE("ALC Switch", WM8962_ALC1, WM8962_ALCL_ENA_SHIFT,
>  		WM8962_ALCR_ENA_SHIFT, 1, 0),
> -SND_SOC_BYTES_MASK("ALC Coefficients", WM8962_ALC1, 4,
> +SND_SOC_BYTES_MASK("ALC1", WM8962_ALC1, 1,
>  		WM8962_ALCL_ENA_MASK | WM8962_ALCR_ENA_MASK),
> +SND_SOC_BYTES("ALC2", WM8962_ALC2, 1),
> +SND_SOC_BYTES("ALC3", WM8962_ALC3, 1),
> +SND_SOC_BYTES("Noise Gate", WM8962_NOISE_GATE, 1),

This doesn't really seem ideal to be changing the interface at
this point in the drivers life.

Looking through the datasheet/driver there are 5 status bits in
the ALC2 register but we don't use them anywhere in the driver
and they don't look like they are likely to be useful to the end
user. I wonder if an easier solution might just be to have the
register be non-volatile?

Thanks,
Charles
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1254240 — Re: [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers

FromMark Brown <broonie@kernel.org>
Date2015-10-23 01:40 +0200
SubjectRe: [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers
Message-ID<qmxCH-Il-25@gated-at.bofh.it>
In reply to#1251269

[Multipart message — attachments visible in raw view] — view raw

On Tue, Oct 20, 2015 at 11:47:12AM +0900, Jiada Wang wrote:
> As ALC2 register is volatile, declare it as one of ALC Coefficients
> register together with other non-volatile registers will cause issue,
> in case wm8962 has enter suspend mode, and cache_only flag is set,
> any attempt to read from ALC2 will fail.
> 
> Instead of declaring one ALC Coefficients register which contains
> ALC1 ~ ALC3 and Noise Gate, this patch declares 4 separate registers,
> so that regmap can handle these registers differently based on their
> classification.

In addition to the issue with the ABI change that Charles raised this
also doesn't entirely fix the issue in that we still have a control that
is going to give an error in suspend mode.  Charles' suggestion seems
like it's more likely to be helpful to users.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web