[PATCH 4/4] ASoC: wm8962: Don't mark WM8962_ADDITIONAL_CONTROL_4 as volatile

Sebastian Krzyszkowiak posted 4 patches 2 days, 20 hours ago
There is a newer version of this series
[PATCH 4/4] ASoC: wm8962: Don't mark WM8962_ADDITIONAL_CONTROL_4 as volatile
Posted by Sebastian Krzyszkowiak 2 days, 20 hours ago
Only some bits of that register are actually volatile, so to prevent issues
with caching let's simply bypass the cache explicitly when we access these
particular bits.

This fixes mic-cfg value not being reapplied after runtime resume.

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
---
 sound/soc/codecs/wm8962.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index dd73b4dc1b97..22101284c095 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -793,7 +793,6 @@ static bool wm8962_volatile_register(struct device *dev, unsigned int reg)
 	case WM8962_CLOCKING1:
 	case WM8962_SOFTWARE_RESET:
 	case WM8962_THERMAL_SHUTDOWN_STATUS:
-	case WM8962_ADDITIONAL_CONTROL_4:
 	case WM8962_DC_SERVO_6:
 	case WM8962_INTERRUPT_STATUS_1:
 	case WM8962_INTERRUPT_STATUS_2:
@@ -3074,7 +3073,9 @@ static void wm8962_mic_work(struct work_struct *work)
 	int irq_pol = 0;
 	int reg;
 
+	regcache_cache_bypass(wm8962->regmap, true);
 	reg = snd_soc_component_read(component, WM8962_ADDITIONAL_CONTROL_4);
+	regcache_cache_bypass(wm8962->regmap, false);
 
 	if (reg & WM8962_MICDET_STS) {
 		status |= SND_JACK_MICROPHONE;

-- 
2.52.0