Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d55ad45 authored by Xiubo Li's avatar Xiubo Li Committed by Mark Brown
Browse files

ASoC: fsl-mpc5200: Use usleep_range() instead of msleep()



Since msleep() will sleep longer than intended time for values less
than 20ms, this patch allows the use of usleep_range for just 1ms.
usleep_range is a finer precision implementation of msleep and is
designed to be a drop-in replacement for udelay where a precise
sleep/busy-wait is unnecessary.

More details see Documentation/timers/timers-howto.txt.

Signed-off-by: default avatarXiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 822ad70a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/delay.h>
#include <linux/time.h>

#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -127,7 +128,7 @@ static void psc_ac97_cold_reset(struct snd_ac97 *ac97)

	mutex_unlock(&psc_dma->mutex);

	msleep(1);
	usleep_range(1000, 2000);
	psc_ac97_warm_reset(ac97);
}