[Sound-open-firmware] [PATCH] [RFC]SOF: FIX: adjust the SSC3's TFT/RFT field in SSP
Wu Zhigang
zhigang.wu at linux.intel.com
Fri May 18 07:31:53 CEST 2018
Actually I did not have full confidence about this patch.
if someone can help do more test, that would be better.
before this, do not accept this patch.
Incorrect TFT/RFT will cause DMA IRQ happened too frequently.
the interval will be less than 1ms, which will cause XRUN easily.
The old code will has this issue in TDM4-s32le test.
Signed-off-by: Wu Zhigang <zhigang.wu at linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
Test with:
APL-GPMRB with TDF8532 codec
Linux sof-v4.14: 1d4a25d72d1e87c182f15a68d32c9599b734ea7b
SOF master: 7c5dd8cfdf4f8ca1fa5cfdd7352b81cbfc8edb88
Tools master: 86fe688a2b4f68a1ce87e0951686be12a00f1a3c
Pass the Sanity test:
BYT(Minnowboard Turbo)
APL(UP^2)
CNL(CNL-RVP)
---
src/drivers/apl-ssp.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/src/drivers/apl-ssp.c b/src/drivers/apl-ssp.c
index a51f91c..5fb9b27 100644
--- a/src/drivers/apl-ssp.c
+++ b/src/drivers/apl-ssp.c
@@ -36,6 +36,7 @@
#include <sof/ssp.h>
#include <sof/alloc.h>
#include <sof/interrupt.h>
+#include <sof/math/numbers.h>
#include <config.h>
/* tracing */
@@ -496,24 +497,8 @@ static inline int ssp_set_config(struct dai *dai,
/* bypass divider for MCLK */
mdivr = 0x00000fff;
- /* setting TFT and RFT */
- switch (config->ssp.sample_valid_bits) {
- case 16:
- /* use 2 bytes for each slot */
- tft = active_tx_slots * 2;
- rft = active_rx_slots * 2;
- break;
- case 24:
- case 32:
- /* use 4 bytes for each slot */
- tft = active_tx_slots * 4;
- rft = active_rx_slots * 4;
- break;
- default:
- trace_ssp_error("ecd");
- ret = -EINVAL;
- goto out;
- }
+ tft = MIN(8, 2 * active_tx_slots);
+ rft = MIN(8, 2 * active_rx_slots);
sscr3 |= SSCR3_TX(tft) | SSCR3_RX(rft);
--
2.14.1
More information about the Sound-open-firmware
mailing list