diff options
author | Xiubo Li <lixiubo@cmss.chinamobile.com> | 2016-01-15 06:35:24 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-22 11:47:52 -0500 |
commit | 512feb4e19a262ea0dfd7209506a998897feaadc (patch) | |
tree | 8586f494132b8d384e332acf759284630f5ffaa6 /sound/soc/fsl | |
parent | c1df29648f1e3ffb8bac38e27a22b50f5c019adf (diff) |
ASoC: fsl_sai: 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: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 43ba5dc26775..4919de9684eb 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/of_address.h> | 17 | #include <linux/of_address.h> |
18 | #include <linux/regmap.h> | 18 | #include <linux/regmap.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/time.h> | ||
20 | #include <sound/core.h> | 21 | #include <sound/core.h> |
21 | #include <sound/dmaengine_pcm.h> | 22 | #include <sound/dmaengine_pcm.h> |
22 | #include <sound/pcm_params.h> | 23 | #include <sound/pcm_params.h> |
@@ -884,7 +885,7 @@ static int fsl_sai_resume(struct device *dev) | |||
884 | regcache_cache_only(sai->regmap, false); | 885 | regcache_cache_only(sai->regmap, false); |
885 | regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR); | 886 | regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR); |
886 | regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR); | 887 | regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR); |
887 | msleep(1); | 888 | usleep_range(1000, 2000); |
888 | regmap_write(sai->regmap, FSL_SAI_TCSR, 0); | 889 | regmap_write(sai->regmap, FSL_SAI_TCSR, 0); |
889 | regmap_write(sai->regmap, FSL_SAI_RCSR, 0); | 890 | regmap_write(sai->regmap, FSL_SAI_RCSR, 0); |
890 | return regcache_sync(sai->regmap); | 891 | return regcache_sync(sai->regmap); |