ASoC: rt5640: use msleep() for long delays
authorNicholas Mc Guire <hofrat@osadl.org>
Thu, 12 Jan 2017 12:09:41 +0000 (13:09 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 12 Jan 2017 17:20:59 +0000 (17:20 +0000)
ulseep_range() uses hrtimers and provides no advantage over msleep()
for larger delays. Fix up the 70/80ms delays here passing the "min"
value to msleep(). This reduces the load on the hrtimer subsystem.

Link: http://lkml.org/lkml/2017/1/11/377
Fixes: commit 246693ba7b0b ("ASoC: rt5640: change widget sequence for depop")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5640.c

index 0f1b2165e01c6ca5160cc2fcf463665cea4c3f22..33e080f80585ecd7297cf43c1a19a11be8795717 100644 (file)
@@ -995,7 +995,7 @@ static int rt5640_hp_event(struct snd_soc_dapm_widget *w,
 
        case SND_SOC_DAPM_PRE_PMD:
                rt5640->hp_mute = 1;
-               usleep_range(70000, 75000);
+               msleep(70);
                break;
 
        default:
@@ -1059,7 +1059,7 @@ static int rt5640_hp_post_event(struct snd_soc_dapm_widget *w,
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
                if (!rt5640->hp_mute)
-                       usleep_range(80000, 85000);
+                       msleep(80);
 
                break;