From 98f1271aec1fd461ab20a1ae145bba630a5750fb Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Fri, 26 Nov 2021 12:49:44 +0000 Subject: [PATCH] x1000: Fix AIC I2S divider clamping with EXCLK source Change-Id: I19c2d25bbd7276ac5efd6f6b3b9ee64d6801f972 --- firmware/target/mips/ingenic_x1000/aic-x1000.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/target/mips/ingenic_x1000/aic-x1000.c b/firmware/target/mips/ingenic_x1000/aic-x1000.c index 1d1768d4f9..ff9802501d 100644 --- a/firmware/target/mips/ingenic_x1000/aic-x1000.c +++ b/firmware/target/mips/ingenic_x1000/aic-x1000.c @@ -84,8 +84,10 @@ static int calc_i2s_clock_params(x1000_clk_t clksrc, *i2sdiv = X1000_EXCLK_FREQ / 64 / fs; /* clamp to maximum value */ - if(*i2sdiv > 0x200) - *i2sdiv = 0x200; + if(*i2sdiv > 512) + *i2sdiv = 512; + if(*i2sdiv == 0) + *i2sdiv = 1; return 0; }