summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs42l42.h
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2022-01-21 12:04:12 +0000
committerMark Brown <broonie@kernel.org>2022-01-24 13:31:35 +0000
commitf8593e88540052b3feaf1fb36f2c1c0484c9dc14 (patch)
tree5c4309ed1f7ddb6e43576c5b126b69e9899fc360 /sound/soc/codecs/cs42l42.h
parent5982b5a8ec7ddb076e774bdd0b17d74681ab0943 (diff)
downloadlinux-f8593e88540052b3feaf1fb36f2c1c0484c9dc14.tar.bz2
ASoC: cs42l42: Handle system suspend
Add system suspend functions to handle clean power-down on suspend and restoring registers on resume. The jack state could change during suspend. Plug->unplug and unplug->plug are straightforward because this looks no different from any other plug state change - there will be a plugged or unplugged interrupt pending. The jack could be unplugged and a different type of jack plugged, and on resume the plug state would not have changed. Setting plug_state back to TS_TRANS (transitioning) will make the next plug interrupt after resume run a type detection. During system suspend any jack plug/unplug and button events will not be reported or generate a system wakeup. If the plug state or headset type has changed it will be reported after resume. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220121120412.672284-4-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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h
index 53d96287abba..244b24d1f5e9 100644
--- a/sound/soc/codecs/cs42l42.h
+++ b/sound/soc/codecs/cs42l42.h
@@ -826,6 +826,10 @@
#define CS42L42_PLL_LOCK_POLL_US 250
#define CS42L42_PLL_LOCK_TIMEOUT_US 1250
#define CS42L42_HP_ADC_EN_TIME_US 20000
+#define CS42L42_PDN_DONE_POLL_US 1000
+#define CS42L42_PDN_DONE_TIMEOUT_US 200000
+#define CS42L42_PDN_DONE_TIME_MS 100
+#define CS42L42_FILT_DISCHARGE_TIME_MS 46
static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = {
"VA",
@@ -860,6 +864,7 @@ struct cs42l42_private {
u8 hs_bias_sense_en;
u8 stream_use;
bool hp_adc_up_pending;
+ bool suspended;
};
#endif /* __CS42L42_H__ */