ASoC: cs42l42: Remove redundant delays in suspend().
authorVitaly Rodionov <vitalyr@opensource.cirrus.com>
Fri, 16 Feb 2024 10:11:57 +0000 (10:11 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 19 Feb 2024 17:02:18 +0000 (17:02 +0000)
This patch will remove redundant delay and minimise
total suspend() function call time.

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://msgid.link/r/20240216101157.23176-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/cs42l42.h
sound/soc/codecs/cs42l42.c

index 3994e933db195627fce912493f707082fe260c5c..1bd8eee54f6665dbd2ea489c4f093a70fa25a5e5 100644 (file)
 #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
+#define CS42L42_PDN_DONE_TIMEOUT_US    235000
+#define CS42L42_PDN_DONE_TIME_MS       65
 
 #endif /* __CS42L42_H */
index 2d11c5125f732bac0c91e91c91d49c54613a8b5c..60d366e53526ff20a36eaea6322a8d8baf194446 100644 (file)
@@ -2195,7 +2195,6 @@ int cs42l42_suspend(struct device *dev)
        /* Discharge FILT+ */
        regmap_update_bits(cs42l42->regmap, CS42L42_PWR_CTL2,
                           CS42L42_DISCHARGE_FILT_MASK, CS42L42_DISCHARGE_FILT_MASK);
-       msleep(CS42L42_FILT_DISCHARGE_TIME_MS);
 
        regcache_cache_only(cs42l42->regmap, true);
        gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);