linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control
@ 2021-08-03 16:08 Richard Fitzgerald
  2021-08-03 16:08 ` [PATCH 2/2] ASoC: cs42l42: Remove duplicate control for WNF filter frequency Richard Fitzgerald
  2021-08-03 22:35 ` [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2021-08-03 16:08 UTC (permalink / raw)
  To: broonie; +Cc: patches, linux-kernel, alsa-devel, Richard Fitzgerald

The underlying register field has inverted sense (0 = enabled) so
the control definition must be marked as inverted.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec")
---
 sound/soc/codecs/cs42l42.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 08ca05bfbeb3..2db87e3a4dc3 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -437,7 +437,7 @@ static SOC_ENUM_SINGLE_DECL(cs42l42_wnf05_freq_enum, CS42L42_ADC_WNF_HPF_CTL,
 static const struct snd_kcontrol_new cs42l42_snd_controls[] = {
 	/* ADC Volume and Filter Controls */
 	SOC_SINGLE("ADC Notch Switch", CS42L42_ADC_CTL,
-				CS42L42_ADC_NOTCH_DIS_SHIFT, true, false),
+				CS42L42_ADC_NOTCH_DIS_SHIFT, true, true),
 	SOC_SINGLE("ADC Weak Force Switch", CS42L42_ADC_CTL,
 				CS42L42_ADC_FORCE_WEAK_VCM_SHIFT, true, false),
 	SOC_SINGLE("ADC Invert Switch", CS42L42_ADC_CTL,
-- 
2.11.0


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

* [PATCH 2/2] ASoC: cs42l42: Remove duplicate control for WNF filter frequency
  2021-08-03 16:08 [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control Richard Fitzgerald
@ 2021-08-03 16:08 ` Richard Fitzgerald
  2021-08-03 22:35 ` [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2021-08-03 16:08 UTC (permalink / raw)
  To: broonie; +Cc: patches, linux-kernel, alsa-devel, Richard Fitzgerald

The driver was defining two ALSA controls that both change the same
register field for the wind noise filter corner frequency. The filter
response has two corners, at different frequencies, and the duplicate
controls most likely were an attempt to be able to set the value using
either of the frequencies.

However, having two controls changing the same field can be problematic
and it is unnecessary. Both frequencies are related to each other so
setting one implies exactly what the other would be.

Removing a control affects user-side code, but there is currently no
known use of the removed control so it would be best to remove it now
before it becomes a problem.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec")
---
 sound/soc/codecs/cs42l42.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 2db87e3a4dc3..a00dc3c65549 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -425,15 +425,6 @@ static SOC_ENUM_SINGLE_DECL(cs42l42_wnf3_freq_enum, CS42L42_ADC_WNF_HPF_CTL,
 			    CS42L42_ADC_WNF_CF_SHIFT,
 			    cs42l42_wnf3_freq_text);
 
-static const char * const cs42l42_wnf05_freq_text[] = {
-	"280Hz", "315Hz", "350Hz", "385Hz",
-	"420Hz", "455Hz", "490Hz", "525Hz"
-};
-
-static SOC_ENUM_SINGLE_DECL(cs42l42_wnf05_freq_enum, CS42L42_ADC_WNF_HPF_CTL,
-			    CS42L42_ADC_WNF_CF_SHIFT,
-			    cs42l42_wnf05_freq_text);
-
 static const struct snd_kcontrol_new cs42l42_snd_controls[] = {
 	/* ADC Volume and Filter Controls */
 	SOC_SINGLE("ADC Notch Switch", CS42L42_ADC_CTL,
@@ -451,7 +442,6 @@ static const struct snd_kcontrol_new cs42l42_snd_controls[] = {
 				CS42L42_ADC_HPF_EN_SHIFT, true, false),
 	SOC_ENUM("HPF Corner Freq", cs42l42_hpf_freq_enum),
 	SOC_ENUM("WNF 3dB Freq", cs42l42_wnf3_freq_enum),
-	SOC_ENUM("WNF 05dB Freq", cs42l42_wnf05_freq_enum),
 
 	/* DAC Volume and Filter Controls */
 	SOC_SINGLE("DACA Invert Switch", CS42L42_DAC_CTL1,
-- 
2.11.0


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

* Re: [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control
  2021-08-03 16:08 [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control Richard Fitzgerald
  2021-08-03 16:08 ` [PATCH 2/2] ASoC: cs42l42: Remove duplicate control for WNF filter frequency Richard Fitzgerald
@ 2021-08-03 22:35 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-08-03 22:35 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: Mark Brown, alsa-devel, linux-kernel, patches

On Tue, 3 Aug 2021 17:08:33 +0100, Richard Fitzgerald wrote:
> The underlying register field has inverted sense (0 = enabled) so
> the control definition must be marked as inverted.
> 
> 
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control
      commit: 30615bd21b4cc3c3bb5ae8bd70e2a915cc5f75c7
[2/2] ASoC: cs42l42: Remove duplicate control for WNF filter frequency
      commit: 8b353bbeae20e2214c9d9d88bcb2fda4ba145d83

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

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

end of thread, other threads:[~2021-08-03 22:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 16:08 [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control Richard Fitzgerald
2021-08-03 16:08 ` [PATCH 2/2] ASoC: cs42l42: Remove duplicate control for WNF filter frequency Richard Fitzgerald
2021-08-03 22:35 ` [PATCH 1/2] ASoC: cs42l42: Fix inversion of ADC Notch Switch control Mark Brown

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).