[RFC PATCH 2/2] ASoC: atmel: mchp-spdifrx: Preserve MR defaults in hw_params
From: phucduc . bui
Date: Thu Nov 19 2026 - 23:00:08 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
hw_params() overwrites the entire MR register, clearing the
VBMODE and SBMODE bits configured in dai_probe().
Use regmap_update_bits() to update only the ENDIAN and DATAWIDTH
fields, preserving the other MR bits.
Fixes: fa09fa60385a ("ASoC: mchp-spdifrx: fix controls which rely on rsr register")
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
Note:
Hardware testing on SAMA7G5 is needed to verify this change.
If the current full-register write is intentional, the issue
may instead be in the default MR configuration in dai_probe().
sound/soc/atmel/mchp-spdifrx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c
index 06a2a5a90a63..e37470165717 100644
--- a/sound/soc/atmel/mchp-spdifrx.c
+++ b/sound/soc/atmel/mchp-spdifrx.c
@@ -502,7 +502,9 @@ static int mchp_spdifrx_hw_params(struct snd_pcm_substream *substream,
dev_dbg(dev->dev, "GCLK range min set to %d\n",
params_rate(params) * SPDIFRX_GCLK_RATIO_MIN + 1);
- ret = regmap_write(dev->regmap, SPDIFRX_MR, mr);
+ ret = regmap_update_bits(dev->regmap, SPDIFRX_MR,
+ SPDIFRX_MR_ENDIAN_MASK | SPDIFRX_MR_DATAWIDTH_MASK,
+ mr);
unlock:
mutex_unlock(&dev->mlock);
--
2.43.0