summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-11-26 12:49:44 +0000
committerAidan MacDonald <amachronic@protonmail.com>2021-11-27 15:27:45 -0500
commit98f1271aec1fd461ab20a1ae145bba630a5750fb (patch)
tree115cd7d8fa9a73841972e961317deae628248a58 /firmware
parentf1215a338b139f6cdea4a927548d0d5406135f0c (diff)
downloadrockbox-98f1271aec1fd461ab20a1ae145bba630a5750fb.tar.gz
rockbox-98f1271aec1fd461ab20a1ae145bba630a5750fb.zip
x1000: Fix AIC I2S divider clamping with EXCLK source
Change-Id: I19c2d25bbd7276ac5efd6f6b3b9ee64d6801f972
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/mips/ingenic_x1000/aic-x1000.c6
1 files 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;
}