[PATCH v2 1/3] ASoC: codecs: nau8360: set val_bits to the widest register size
From: Raffaele Tranfaglia via B4 Relay
Date: Wed Nov 25 2026 - 03:10:00 EST
From: Raffaele Tranfaglia <raffaele.tranfaglia@xxxxxxxxx>
The regmap is configured with val_bits = 16, but the two DSP registers
are 32 bits wide: nau8360_reg_write() sends four bytes for them, and the
DSP messages written with snd_soc_component_write() use all 32 bits.
This works because the driver provides its own reg_read() and
reg_write() and regmap passes the value through unmodified. As regmap is
going to mask values to val_bits, set it to 32, the size of the widest
register. The size of each access is still selected in the driver's
reg_read() and reg_write().
Signed-off-by: Raffaele Tranfaglia <raffaele.tranfaglia@xxxxxxxxx>
---
sound/soc/codecs/nau8360.c | 3 ++-
sound/soc/codecs/nau8360.h | 3 +--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/nau8360.c b/sound/soc/codecs/nau8360.c
index f0942739d7ab..d4cab3c8e29d 100644
--- a/sound/soc/codecs/nau8360.c
+++ b/sound/soc/codecs/nau8360.c
@@ -1918,7 +1918,8 @@ static int nau8360_reg_read(void *context, unsigned int reg, unsigned int *value
static const struct regmap_config nau8360_regmap_config = {
.reg_bits = NAU8360_REG_ADDR_LEN,
- .val_bits = NAU8360_REG_DATA_LEN,
+ /* Codec registers are 16 bits wide, DSP registers are 32 bits wide */
+ .val_bits = 32,
.max_register = NAU8360_REG_MAX,
.readable_reg = nau8360_readable_reg,
diff --git a/sound/soc/codecs/nau8360.h b/sound/soc/codecs/nau8360.h
index 71396747c0fa..3d9711804073 100644
--- a/sound/soc/codecs/nau8360.h
+++ b/sound/soc/codecs/nau8360.h
@@ -123,9 +123,8 @@
#define NAU8360_RF002_DSP_COMM 0xf002
#define NAU8360_REG_MAX NAU8360_RF002_DSP_COMM
-/* 16-bit control register address, and 16-bits control register data */
+/* 16-bit control register address */
#define NAU8360_REG_ADDR_LEN 16
-#define NAU8360_REG_DATA_LEN 16
/* NAU8360_R03_CLK_CTRL0 (0x03) */
#define NAU8360_MCLK_DIV_SFT 10
--
2.56.0