diff mbox series

ASoC: wm8904: Fill the cache for WM8904_ADC_TEST_0 register

Message ID 20230723-asoc-fix-wm8904-adc-test-read-v1-1-2cdf2edd83fd@kernel.org (mailing list archive)
State Accepted
Commit f061e2be8689057cb4ec0dbffa9f03e1a23cdcb2
Headers show
Series ASoC: wm8904: Fill the cache for WM8904_ADC_TEST_0 register | expand

Commit Message

Mark Brown July 22, 2023, 11:27 p.m. UTC
The WM8904_ADC_TEST_0 register is modified as part of updating the OSR
controls but does not have a cache default, leading to errors when we try
to modify these controls in cache only mode with no prior read:

wm8904 3-001a: ASoC: error at snd_soc_component_update_bits on wm8904.3-001a for register: [0x000000c6] -16

Add a read of the register to probe() to fill the cache and avoid both the
error messages and the misconfiguration of the chip which will result.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/wm8904.c | 3 +++
 1 file changed, 3 insertions(+)


---
base-commit: fdf0eaf11452d72945af31804e2a1048ee1b574c
change-id: 20230722-asoc-fix-wm8904-adc-test-read-5a0051264a0b

Best regards,

Comments

Charles Keepax July 24, 2023, 8:29 a.m. UTC | #1
On Sun, Jul 23, 2023 at 12:27:22AM +0100, Mark Brown wrote:
> The WM8904_ADC_TEST_0 register is modified as part of updating the OSR
> controls but does not have a cache default, leading to errors when we try
> to modify these controls in cache only mode with no prior read:
> 
> wm8904 3-001a: ASoC: error at snd_soc_component_update_bits on wm8904.3-001a for register: [0x000000c6] -16
> 
> Add a read of the register to probe() to fill the cache and avoid both the
> error messages and the misconfiguration of the chip which will result.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
Mark Brown July 24, 2023, 8:44 p.m. UTC | #2
On Sun, 23 Jul 2023 00:27:22 +0100, Mark Brown wrote:
> The WM8904_ADC_TEST_0 register is modified as part of updating the OSR
> controls but does not have a cache default, leading to errors when we try
> to modify these controls in cache only mode with no prior read:
> 
> wm8904 3-001a: ASoC: error at snd_soc_component_update_bits on wm8904.3-001a for register: [0x000000c6] -16
> 
> Add a read of the register to probe() to fill the cache and avoid both the
> error messages and the misconfiguration of the chip which will result.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: wm8904: Fill the cache for WM8904_ADC_TEST_0 register
      commit: f061e2be8689057cb4ec0dbffa9f03e1a23cdcb2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 068e610b1b4c..f2baee7c332e 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -2308,6 +2308,9 @@  static int wm8904_i2c_probe(struct i2c_client *i2c)
 	regmap_update_bits(wm8904->regmap, WM8904_BIAS_CONTROL_0,
 			    WM8904_POBCTRL, 0);
 
+	/* Fill the cache for the ADC test register */
+	regmap_read(wm8904->regmap, WM8904_ADC_TEST_0, &val);
+
 	/* Can leave the device powered off until we need it */
 	regcache_cache_only(wm8904->regmap, true);
 	regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), wm8904->supplies);