aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2015-09-14 09:06:48 -0400
committerMark Brown <broonie@kernel.org>2015-09-14 12:29:41 -0400
commit723831927e8813b5b336d383174f686ad708bf10 (patch)
tree5ce18c062b6f2c2fc1e5b67ecad6973aa1b06bf8
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff)
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>
-rw-r--r--sound/soc/davinci/davinci-mcasp.c7
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,
663 u8 rx_ser = 0; 663 u8 rx_ser = 0;
664 u8 slots = mcasp->tdm_slots; 664 u8 slots = mcasp->tdm_slots;
665 u8 max_active_serializers = (channels + slots - 1) / slots; 665 u8 max_active_serializers = (channels + slots - 1) / slots;
666 int active_serializers, numevt, n; 666 int active_serializers, numevt;
667 u32 reg; 667 u32 reg;
668 /* Default configuration */ 668 /* Default configuration */
669 if (mcasp->version < MCASP_VERSION_3) 669 if (mcasp->version < MCASP_VERSION_3)
@@ -745,9 +745,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
745 * The number of words for numevt need to be in steps of active 745 * The number of words for numevt need to be in steps of active
746 * serializers. 746 * serializers.
747 */ 747 */
748 n = numevt % active_serializers; 748 numevt = (numevt / active_serializers) * active_serializers;
749 if (n) 749
750 numevt += (active_serializers - n);
751 while (period_words % numevt && numevt > 0) 750 while (period_words % numevt && numevt > 0)
752 numevt -= active_serializers; 751 numevt -= active_serializers;
753 if (numevt <= 0) 752 if (numevt <= 0)