]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: cs42l42: Add warnings about DETECT_MODE and PLL_START
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Fri, 4 Mar 2022 14:40:15 +0000 (14:40 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 7 Mar 2022 13:14:59 +0000 (13:14 +0000)
commitf614454911867fd5a228f9f3a0a881569f27373b
tree852ddb46b70b9b55f5a6d50d1be32591f54d1d40
parentbca3610220dee6b66705537d091ce8226c647f57
ASoC: cs42l42: Add warnings about DETECT_MODE and PLL_START

DETECT_MODE and PLL_START must be zero while HP_PDN and ADC_PDN are
both 1. If this condition is broken it can discharge FILT+ and it
can then take up to 1 second for FILT+ to recharge.

There is no workaround required for this, simply avoiding settings
and sequences that would break the requirement. The driver already
meets the requirement.

But it is not obvious from reading the code that this requirement
exists, or what is ensuring it is met. So it would not currently be
obvious to someone changing the code that there is certain special
behaviour that must be maintained.

To avoid accidental breakage in the future:

- Add comments into the register definitions to warn about this so
  that anyone changing the code around DETECT_MODE and PLL_START is
  aware of this requirement.

- Add a comment where PLL_START is written to 1 to highlight the
  requirement and why it is satisfied.

- Add a comment in cs42l42_setup_hs_type_detect() when DETECT_MODE is
  initialized.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220304144015.398656-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l42.c
sound/soc/codecs/cs42l42.h