summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2018-11-14 14:06:21 +0300
committerMark Brown <broonie@kernel.org>2018-11-23 17:04:37 +0300
commitdd2f52d8991af9fe0928d59ec502ba52be7bc38d (patch)
treecfd546f5ac4826178f1024a06a98d0a6936b86f6 /sound/soc
parenta3e620f8422832afd832ad5e20aa97d0c72bada8 (diff)
downloadlinux-dd2f52d8991af9fe0928d59ec502ba52be7bc38d.tar.xz
ASoC: omap-mcbsp: Fix latency value calculation for pm_qos
The latency number is in usec for the pm_qos. Correct the calculation to give us the time in usec Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/omap/omap-mcbsp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index d0ebb6b9bfac..2d6decbfc99e 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -308,9 +308,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
pkt_size = channels;
}
- latency = ((((buffer_size - pkt_size) / channels) * 1000)
- / (params->rate_num / params->rate_den));
-
+ latency = (buffer_size - pkt_size) / channels;
+ latency = latency * USEC_PER_SEC /
+ (params->rate_num / params->rate_den);
mcbsp->latency[substream->stream] = latency;
omap_mcbsp_set_threshold(substream, pkt_size);