Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: tas5720: set bit 7 in ANALOG_CTRL_REG for TAS5720A-Q1 during probe

Set the reserved bit 7 in the ANALOG_CTRL_REG for the TAS5720A-Q1 device,
when probing.
The datasheet mentions that the bit should be 1 during reset/powerup.

The device did not initialize before setting this value to 1. So, this
could be a quirk of this device. Or it could be a quirk with the board on
which it was tested.
That is why this patch is separate from the patch that adds support for the
TAS5720A-Q1 device.

Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de>
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230128082744.41849-3-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Steffen Aschbacher and committed by
Mark Brown
88f748e3 c24a62be

+14
+13
sound/soc/codecs/tas5720.c
··· 351 351 if (ret < 0) 352 352 goto error_snd_soc_component_update_bits; 353 353 354 + /* Set Bit 7 in TAS5720_ANALOG_CTRL_REG to 1 for TAS5720A_Q1 */ 355 + switch (tas5720->devtype) { 356 + case TAS5720A_Q1: 357 + ret = snd_soc_component_update_bits(component, TAS5720_ANALOG_CTRL_REG, 358 + TAS5720_Q1_RESERVED7_BIT, 359 + TAS5720_Q1_RESERVED7_BIT); 360 + break; 361 + default: 362 + break; 363 + } 364 + if (ret < 0) 365 + goto error_snd_soc_component_update_bits; 366 + 354 367 /* 355 368 * Enter shutdown mode - our default when not playing audio - to 356 369 * minimize current consumption. On the TAS5720 there is no real down
+1
sound/soc/codecs/tas5720.h
··· 81 81 #define TAS5720_ANALOG_GAIN_SHIFT (0x2) 82 82 83 83 /* TAS5720_Q1_ANALOG_CTRL_REG */ 84 + #define TAS5720_Q1_RESERVED7_BIT BIT(7) 84 85 #define TAS5720_Q1_CHAN_SEL BIT(1) 85 86 86 87 /* TAS5720_FAULT_REG */