diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2022-03-30 21:14:18 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2022-03-30 21:14:18 -0700 |
commit | 5710faba8a2a15349c9001bd4b2cd958e56c90fa (patch) | |
tree | 80694ac211cac1b2347c3c905b38d86139dc51c1 /sound/soc/codecs/rt5668.c | |
parent | 5600f6986628dde8881734090588474f54a540a8 (diff) | |
parent | a949087c2285c8de4f0f204cab2d4eece9d929a2 (diff) |
Merge branch 'next' into for-linus
Prepare input updates for 5.18 merge window.
Diffstat (limited to 'sound/soc/codecs/rt5668.c')
-rw-r--r-- | sound/soc/codecs/rt5668.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt5668.c b/sound/soc/codecs/rt5668.c index fb09715bf932..5b12cbf2ba21 100644 --- a/sound/soc/codecs/rt5668.c +++ b/sound/soc/codecs/rt5668.c @@ -1022,11 +1022,13 @@ static void rt5668_jack_detect_handler(struct work_struct *work) container_of(work, struct rt5668_priv, jack_detect_work.work); int val, btn_type; - while (!rt5668->component) - usleep_range(10000, 15000); - - while (!rt5668->component->card->instantiated) - usleep_range(10000, 15000); + if (!rt5668->component || !rt5668->component->card || + !rt5668->component->card->instantiated) { + /* card not yet ready, try later */ + mod_delayed_work(system_power_efficient_wq, + &rt5668->jack_detect_work, msecs_to_jiffies(15)); + return; + } mutex_lock(&rt5668->calibrate_mutex); |