summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5677.h
diff options
context:
space:
mode:
authorBen Zhang <benzh@chromium.org>2019-11-06 04:13:32 +0300
committerMark Brown <broonie@kernel.org>2019-11-11 16:02:04 +0300
commitee0be4a99d4923a9b9c681b008df561648731793 (patch)
tree91c30d7a81f0b2db0e53ae26fff35fad348d6f60 /sound/soc/codecs/rt5677.h
parent3f81068dc8e5fc0d3b0d67a5ae99c5140a4e96cb (diff)
downloadlinux-ee0be4a99d4923a9b9c681b008df561648731793.tar.xz
ASoC: rt5677: Disable irq at suspend
The irq is disabled at suspend to avoid running the threaded irq handler after the codec has been powered off. At resume, codec irq is re-enabled and the interrupt status register is checked to see if headphone has been pluggnd/unplugged while the device is suspended. There is still a chance that the headphone gets enabled or disabled after the codec is suspended. disable_irq syncs the threaded irq handler, but soc-jack's threaded irq handler schedules a delayed work to poll gpios (for debounce). This is still OK. The codec won't be powered back on again because all audio paths have been suspended, and there are no force enabled supply widgets (MICBIAS1 is disabled). The gpio status read after codec power off could be wrong, so the gpio values are checked again after resume. Signed-off-by: Ben Zhang <benzh@chromium.org> Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> Link: https://lore.kernel.org/r/20191106011335.223061-8-cujomalainey@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5677.h')
-rw-r--r--sound/soc/codecs/rt5677.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5677.h b/sound/soc/codecs/rt5677.h
index 046ed2ee8e31..f8ada967fdbc 100644
--- a/sound/soc/codecs/rt5677.h
+++ b/sound/soc/codecs/rt5677.h
@@ -1856,6 +1856,8 @@ struct rt5677_priv {
struct irq_domain *domain;
struct mutex irq_lock;
unsigned int irq_en;
+ struct delayed_work resume_irq_check;
+ int irq;
int (*set_dsp_vad)(struct snd_soc_component *component, bool on);
};