ASoC: cs42l43: Move headset bias sense enable earlier in process
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 19 Sep 2023 10:31:15 +0000 (11:31 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 19 Sep 2023 12:49:01 +0000 (13:49 +0100)
commit1e4ce0d5c023e8d8663f6b79b98b9f8026776127
tree0002c3f1d104ab6cd5b40f7df6652cf429f90774
parent9c0ccc9f8e3be79ab44f5f8034ef90c367caf06f
ASoC: cs42l43: Move headset bias sense enable earlier in process

Currently the bias sense is enabled along with the button detect, but
this has two problems. Firstly, the detections themselves arn't covered
by the bias sense, potentially resulting in pops and secondly, the
sequence of enabling/disabling looks like:

enable bias
enable bias sense
disable bias sense
disable bias

When the bias sense is disabled but the bias is still on the clamp is
removed and a pop results. Fix both of these issues by moving the bias
sense enable/disable to be along with the bias itself. With a resulting
sequence of:

enable bias sense
enable bias
disable bias
disable bias sense

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l43-jack.c