Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs35l56: Fix illegal writes to OTP_MEM registers

Mark the OTP_MEM registers as volatile so that regcache_sync() will not
attempt to write to them.

These registers hold a constant, and originally they were marked as
readable non-volatile so that this value would be read into the regmap
cache. The problem with this is regcache_sync() issues a write for any
cached register that does not have a reg_default.

Though these registers are constants and writing them in normal use
cannot change OTP, it is illegal for the host to write to them.

Fixes: e1830f66f6c6 ("ASoC: cs35l56: Add helper functions for amp calibration")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260428115228.158252-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
be102efb 13d30682

+3 -4
+3 -4
sound/soc/codecs/cs35l56-shared.c
··· 108 108 EXPORT_SYMBOL_NS_GPL(cs35l56_set_patch, "SND_SOC_CS35L56_SHARED"); 109 109 110 110 static const struct reg_default cs35l56_reg_defaults[] = { 111 - /* no defaults for OTP_MEM - first read populates cache */ 112 - 113 111 { CS35L56_ASP1_ENABLES1, 0x00000000 }, 114 112 { CS35L56_ASP1_CONTROL1, 0x00000028 }, 115 113 { CS35L56_ASP1_CONTROL2, 0x18180200 }, ··· 136 138 }; 137 139 138 140 static const struct reg_default cs35l63_reg_defaults[] = { 139 - /* no defaults for OTP_MEM - first read populates cache */ 140 - 141 141 { CS35L56_ASP1_ENABLES1, 0x00000000 }, 142 142 { CS35L56_ASP1_CONTROL1, 0x00000028 }, 143 143 { CS35L56_ASP1_CONTROL2, 0x18180200 }, ··· 278 282 case CS35L56_GLOBAL_ENABLES: /* owned by firmware */ 279 283 case CS35L56_BLOCK_ENABLES: /* owned by firmware */ 280 284 case CS35L56_BLOCK_ENABLES2: /* owned by firmware */ 285 + case CS35L56_OTP_MEM_53: 286 + case CS35L56_OTP_MEM_54: 287 + case CS35L56_OTP_MEM_55: 281 288 case CS35L56_SYNC_GPIO1_CFG ... CS35L56_ASP2_DIO_GPIO13_CFG: 282 289 case CS35L56_UPDATE_REGS: 283 290 case CS35L56_REFCLK_INPUT: /* owned by firmware */