Commit 72383192 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

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: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6ff33f39
...@@ -663,7 +663,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, ...@@ -663,7 +663,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
u8 rx_ser = 0; u8 rx_ser = 0;
u8 slots = mcasp->tdm_slots; u8 slots = mcasp->tdm_slots;
u8 max_active_serializers = (channels + slots - 1) / slots; u8 max_active_serializers = (channels + slots - 1) / slots;
int active_serializers, numevt, n; int active_serializers, numevt;
u32 reg; u32 reg;
/* Default configuration */ /* Default configuration */
if (mcasp->version < MCASP_VERSION_3) if (mcasp->version < MCASP_VERSION_3)
...@@ -745,9 +745,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, ...@@ -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 * The number of words for numevt need to be in steps of active
* serializers. * serializers.
*/ */
n = numevt % active_serializers; numevt = (numevt / active_serializers) * active_serializers;
if (n)
numevt += (active_serializers - n);
while (period_words % numevt && numevt > 0) while (period_words % numevt && numevt > 0)
numevt -= active_serializers; numevt -= active_serializers;
if (numevt <= 0) if (numevt <= 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment