]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: cs42l42: Report full jack status when plug is detected
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Fri, 21 Jan 2022 12:04:10 +0000 (12:04 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 24 Jan 2022 13:31:33 +0000 (13:31 +0000)
commitf910b6a8a64ed06a98a98906edaa9d1df6c4f92b
tree7dfe46b364e290d373bf7f2337dbd5258115323c
parent6d625e8a9b9018c6c716b8985ae4c00dacb379be
ASoC: cs42l42: Report full jack status when plug is detected

When a plug event is detect report the full state of all status
bits, don't assume that there will have been a previous unplug
event to clear all the bits. Report the state of both HEADPHONE
and MICROPHONE bits according to detected type, and clear all the
button status bits. The current button status is already checked
and reported at the end of the function.

During a system suspend the jack could be unplugged and plugged,
possibly changing the jack type. On resume the interrupt status will
indicate a plug event - there will not be an unplug event to clear
the bits.

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