summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/nau8824.h
diff options
context:
space:
mode:
authorSJLIN0 <SJLIN0@nuvoton.com>2022-09-15 04:28:00 +0300
committerMark Brown <broonie@kernel.org>2022-09-19 20:35:23 +0300
commit7042bde216ada135b2f88423ae714ab9a22e3a22 (patch)
treee95b169369d21c6acd0ff935d0735ff1a6ae3c73 /sound/soc/codecs/nau8824.h
parent4a13c949501902d4e6b59cc693005f4ca352dc15 (diff)
downloadlinux-7042bde216ada135b2f88423ae714ab9a22e3a22.tar.xz
ASoC: nau8824: Fix semaphore is released unexpectedly
On resuming, we anticipate that the jack is detected before playback or capture. Therefore, we use semaphore to control the jack detection done without any bothering. During booting, the driver launches jack detection and releases the semaphore. However, it doesn't perceive the maniputation of semaphore is not like resuming procedure. This makes the semaphore's count value become to 2. There is more than one thread can enter into the critical section. This may get unexpected situation and make some chaos. Signed-off-by: SJLIN0 <SJLIN0@nuvoton.com> Signed-off-by: Wallace Lin <savagecin@gmail.com> Link: https://lore.kernel.org/r/20220915012800.825196-1-SJLIN0@nuvoton.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/nau8824.h')
-rw-r--r--sound/soc/codecs/nau8824.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/nau8824.h b/sound/soc/codecs/nau8824.h
index de4bae8281d0..5fcfc43dfc85 100644
--- a/sound/soc/codecs/nau8824.h
+++ b/sound/soc/codecs/nau8824.h
@@ -436,6 +436,7 @@ struct nau8824 {
struct semaphore jd_sem;
int fs;
int irq;
+ int resume_lock;
int micbias_voltage;
int vref_impedance;
int jkdet_polarity;