[alsa-devel] [PATCH 6/6] ASoC: cs53l30: Mark chip ID registers as volatile

Charles Keepax ckeepax at opensource.wolfsonmicro.com
Mon Oct 24 11:55:49 CEST 2016


Mark the chip ID registers as volatile, the current code does work as
without a default value regmap will read from the hardware the first
time, however, this makes it more explicit that this register should be
read from the hardware.

Signed-off-by: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>
---
 sound/soc/codecs/cs53l30.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c
index cb47fb5..b4f0a43 100644
--- a/sound/soc/codecs/cs53l30.c
+++ b/sound/soc/codecs/cs53l30.c
@@ -89,10 +89,16 @@ static const struct reg_default cs53l30_reg_defaults[] = {
 
 static bool cs53l30_volatile_register(struct device *dev, unsigned int reg)
 {
-	if (reg == CS53L30_IS)
+	switch (reg) {
+	case CS53L30_DEVID_AB:
+	case CS53L30_DEVID_CD:
+	case CS53L30_DEVID_E:
+	case CS53L30_REVID:
+	case CS53L30_IS:
 		return true;
-	else
+	default:
 		return false;
+	}
 }
 
 static bool cs53l30_writeable_register(struct device *dev, unsigned int reg)
-- 
2.1.4



More information about the Alsa-devel mailing list