diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-09-14 16:06:48 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-09-14 17:29:41 +0100 |
commit | 723831927e8813b5b336d383174f686ad708bf10 (patch) | |
tree | 5ce18c062b6f2c2fc1e5b67ecad6973aa1b06bf8 /sound | |
parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) | |
download | linux-723831927e8813b5b336d383174f686ad708bf10.tar.gz linux-723831927e8813b5b336d383174f686ad708bf10.tar.bz2 linux-723831927e8813b5b336d383174f686ad708bf10.zip |
ASoC: davinci-mcasp: Revise the FIFO threshold calculation
The FIFO threshold for McASP should be <=[tx/rx]numevt so the initial value
for the refining should meet this requirement as well.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index add6bb99661d..1260b315a96c 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -663,7 +663,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, u8 rx_ser = 0; u8 slots = mcasp->tdm_slots; u8 max_active_serializers = (channels + slots - 1) / slots; - int active_serializers, numevt, n; + int active_serializers, numevt; u32 reg; /* Default configuration */ if (mcasp->version < MCASP_VERSION_3) @@ -745,9 +745,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, * The number of words for numevt need to be in steps of active * serializers. */ - n = numevt % active_serializers; - if (n) - numevt += (active_serializers - n); + numevt = (numevt / active_serializers) * active_serializers; + while (period_words % numevt && numevt > 0) numevt -= active_serializers; if (numevt <= 0) |