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>
This commit is contained in:
Peter Ujfalusi 2018-11-14 13:06:21 +02:00 committed by Mark Brown
parent a3e620f842
commit dd2f52d899
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 3 additions and 3 deletions

View File

@ -308,9 +308,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
pkt_size = channels; pkt_size = channels;
} }
latency = ((((buffer_size - pkt_size) / channels) * 1000) latency = (buffer_size - pkt_size) / channels;
/ (params->rate_num / params->rate_den)); latency = latency * USEC_PER_SEC /
(params->rate_num / params->rate_den);
mcbsp->latency[substream->stream] = latency; mcbsp->latency[substream->stream] = latency;
omap_mcbsp_set_threshold(substream, pkt_size); omap_mcbsp_set_threshold(substream, pkt_size);