diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2018-11-14 14:06:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-17 11:28:50 +0300 |
commit | 4a3fa2a5fed133fd2f26e5f37acdb23ad6e0900c (patch) | |
tree | 03bad7a832e5ccc077e6fd4259f7c53a1f0ff3f1 /sound | |
parent | a625d3e3ce05d05f8f2e1e5d4546d12c94feec4d (diff) | |
download | linux-4a3fa2a5fed133fd2f26e5f37acdb23ad6e0900c.tar.xz |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 6b40bdbef336..47c2ed5ca492 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); |