summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2018-11-14 13:06:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-17 09:24:34 +0100
commitabf7201316a357adf3ef64e70f1599c52edaf59e (patch)
tree2a9ace853e1f8766639fde2ee257df6b9420ba7f /sound
parent1f1aedd6b19a1e07c3d830842e36258fb9d47b4d (diff)
downloadlinux-stable-abf7201316a357adf3ef64e70f1599c52edaf59e.tar.gz
linux-stable-abf7201316a357adf3ef64e70f1599c52edaf59e.tar.bz2
linux-stable-abf7201316a357adf3ef64e70f1599c52edaf59e.zip
ASoC: omap-mcbsp: Fix latency value calculation for pm_qos
[ Upstream commit dd2f52d8991af9fe0928d59ec502ba52be7bc38d ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-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);