diff options
author | Richard Fitzgerald <rf@opensource.cirrus.com> | 2021-11-19 13:48:54 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-11-22 16:40:32 +0100 |
commit | fdd535283779ec9f9c35fda352585c629121214f (patch) | |
tree | 2fd5f87afd592eabc3afd290f9812329dd4e33f3 /sound/soc/codecs/cs42l42.h | |
parent | ASoC: SOF: sof-pci-dev: use community key on all Up boards (diff) | |
download | linux-fdd535283779ec9f9c35fda352585c629121214f.tar.xz linux-fdd535283779ec9f9c35fda352585c629121214f.zip |
ASoC: cs42l42: Report initial jack state
When a jack handler is registered in cs42l42_set_jack() the
initial state should be reported if an attached headphone/headset
has already been detected.
The jack detect sequence takes around 1 second: typically long
enough for the machine driver to probe and register the jack handler
in time to receive the first report from the interrupt handler. So
it is possible on some systems that the correct initial state was seen
simply because of lucky timing. Modular builds were more likely to
miss the reporting of the initial state.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 4ca239f33737 ("ASoC: cs42l42: Always enable TS_PLUG and TS_UNPLUG interrupts")
Link: https://lore.kernel.org/r/20211119124854.58939-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs42l42.h')
-rw-r--r-- | sound/soc/codecs/cs42l42.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h index 75ade987d0db..9fff183dce8e 100644 --- a/sound/soc/codecs/cs42l42.h +++ b/sound/soc/codecs/cs42l42.h @@ -12,6 +12,7 @@ #ifndef __CS42L42_H__ #define __CS42L42_H__ +#include <linux/mutex.h> #include <sound/jack.h> #define CS42L42_PAGE_REGISTER 0x00 /* Page Select Register */ @@ -841,6 +842,7 @@ struct cs42l42_private { struct gpio_desc *reset_gpio; struct completion pdn_done; struct snd_soc_jack *jack; + struct mutex jack_detect_mutex; int pll_config; int bclk; u32 sclk; |