Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: cs35l56: Bugfixes to series "Prepare for SDCA Companion Amp"
@ 2026-11-26 15:44 Richard Fitzgerald
  2026-11-26 15:44 ` [PATCH 1/2] ASoC: cs35l56: Make SoundWire DP3 mixer registers volatile Richard Fitzgerald
  2026-11-26 15:44 ` [PATCH 2/2] ASoC: cs35l56-test: Initialize DP3 mixer registers in mock regmap Richard Fitzgerald
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2026-11-26 15:44 UTC (permalink / raw)
  To: broonie; +Cc: linux-sound, linux-kernel, patches

These two patches fix a couple of bugs in the previous series commit
f5419389a940 ("ASoC: cs35l56: Prepare for SDCA Companion Amp")

Richard Fitzgerald (2):
  ASoC: cs35l56: Make SoundWire DP3 mixer registers volatile
  ASoC: cs35l56-test: Initialize DP3 mixer registers in mock regmap

 sound/soc/codecs/cs35l56-shared.c | 4 ++++
 sound/soc/codecs/cs35l56-test.c   | 1 +
 2 files changed, 5 insertions(+)

-- 
2.47.3


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

* [PATCH 1/2] ASoC: cs35l56: Make SoundWire DP3 mixer registers volatile
  2026-11-26 15:44 [PATCH 0/2] ASoC: cs35l56: Bugfixes to series "Prepare for SDCA Companion Amp" Richard Fitzgerald
@ 2026-11-26 15:44 ` Richard Fitzgerald
  2026-11-26 15:44 ` [PATCH 2/2] ASoC: cs35l56-test: Initialize DP3 mixer registers in mock regmap Richard Fitzgerald
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2026-11-26 15:44 UTC (permalink / raw)
  To: broonie; +Cc: linux-sound, linux-kernel, patches

Mark the CS35L56_SWIRE_DP3_CH*_INPUT registers as volatile so that
reading them won't populate the regmap cache with a value that overwrites
the register value during a regcache_sync().

These registers are owned by the firmware so the driver must not write
to them. Previous commit f52668f474f1 ("ASoC: cs35l56: Remove SDW1 TX
source controls and widgets") removed the DAPM widgets so that the driver
does not read or write these registers. But it left the possibility that
reading the regmap through debugfs would populate the cache value and so
unintentionally overwrite them on the next regcache_sync(). Marking them
volatile prevents this.

Fixes: f52668f474f1 ("ASoC: cs35l56: Remove SDW1 TX source controls and widgets")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/codecs/cs35l56-shared.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index 34aebf81f4a4..329351de32b1 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -232,6 +232,10 @@ static bool cs35l56_common_volatile_reg(unsigned int reg)
 	case CS35L56_DACPCM2_INPUT:		   /* owned by firmware */
 	case CS35L56_DSP1RX1_INPUT:		   /* owned by firmware */
 	case CS35L56_DSP1RX2_INPUT:		   /* owned by firmware */
+	case CS35L56_SWIRE_DP3_CH1_INPUT:	   /* owned by firmware */
+	case CS35L56_SWIRE_DP3_CH2_INPUT:	   /* owned by firmware */
+	case CS35L56_SWIRE_DP3_CH3_INPUT:	   /* owned by firmware */
+	case CS35L56_SWIRE_DP3_CH4_INPUT:	   /* owned by firmware */
 	case CS35L56_IRQ1_STATUS:
 	case CS35L56_IRQ1_EINT_1 ... CS35L56_IRQ1_EINT_8:
 	case CS35L56_IRQ1_EINT_18:
-- 
2.47.3


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

* [PATCH 2/2] ASoC: cs35l56-test: Initialize DP3 mixer registers in mock regmap
  2026-11-26 15:44 [PATCH 0/2] ASoC: cs35l56: Bugfixes to series "Prepare for SDCA Companion Amp" Richard Fitzgerald
  2026-11-26 15:44 ` [PATCH 1/2] ASoC: cs35l56: Make SoundWire DP3 mixer registers volatile Richard Fitzgerald
@ 2026-11-26 15:44 ` Richard Fitzgerald
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2026-11-26 15:44 UTC (permalink / raw)
  To: broonie; +Cc: linux-sound, linux-kernel, patches

In cs35l56_test_create_mock_device_registers() put dummy values in the
simulated CS35L56_SWIRE_DP3_CH*_INPUT registers so that they can be read.

This fixes a problem with the cs35l56_test_component_probe_omits_sdw_mux()
test. The test aims to prove that component_probe() does not put a value
in the regmap cache that will be written out to the registers during a
regcache_sync(). But the registers did not have a value in the simulated
regmap, so an attempt to read the register would fail instead of
populating the cache.

Fixes: 406541bbf4eb ("ASoC: cs35l56: Add test that probe() doesn't write SDW mux registers")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/codecs/cs35l56-test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/cs35l56-test.c b/sound/soc/codecs/cs35l56-test.c
index 362da30b949e..2285076b9d0e 100644
--- a/sound/soc/codecs/cs35l56-test.c
+++ b/sound/soc/codecs/cs35l56-test.c
@@ -280,6 +280,7 @@ static void cs35l56_test_create_mock_device_registers(struct kunit *test)
 
 	cs35l56_test_fill_register_range(test, &cs35l56_test_asp_config_registers_range, 0);
 	cs35l56_test_fill_register_range(test, &cs35l56_test_asp_mixer_registers_range, 0);
+	cs35l56_test_fill_register_range(test, &cs35l56_test_sdw_mux_registers_range, 0);
 }
 
 /*
-- 
2.47.3


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

end of thread, other threads:[~2026-11-26 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 15:44 [PATCH 0/2] ASoC: cs35l56: Bugfixes to series "Prepare for SDCA Companion Amp" Richard Fitzgerald
2026-11-26 15:44 ` [PATCH 1/2] ASoC: cs35l56: Make SoundWire DP3 mixer registers volatile Richard Fitzgerald
2026-11-26 15:44 ` [PATCH 2/2] ASoC: cs35l56-test: Initialize DP3 mixer registers in mock regmap Richard Fitzgerald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox