aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sunxi/sun4i-i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sunxi/sun4i-i2s.c')
-rw-r--r--sound/soc/sunxi/sun4i-i2s.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 77b7b81daf74..0a5fb9d4b289 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -240,11 +240,10 @@ static int sun4i_i2s_get_bclk_div(struct sun4i_i2s *i2s,
240} 240}
241 241
242static int sun4i_i2s_get_mclk_div(struct sun4i_i2s *i2s, 242static int sun4i_i2s_get_mclk_div(struct sun4i_i2s *i2s,
243 unsigned int oversample_rate, 243 unsigned long parent_rate,
244 unsigned int module_rate, 244 unsigned long mclk_rate)
245 unsigned int sampling_rate)
246{ 245{
247 int div = module_rate / sampling_rate / oversample_rate; 246 int div = parent_rate / mclk_rate;
248 int i; 247 int i;
249 248
250 for (i = 0; i < ARRAY_SIZE(sun4i_i2s_mclk_div); i++) { 249 for (i = 0; i < ARRAY_SIZE(sun4i_i2s_mclk_div); i++) {
@@ -323,8 +322,7 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai,
323 return -EINVAL; 322 return -EINVAL;
324 } 323 }
325 324
326 mclk_div = sun4i_i2s_get_mclk_div(i2s, oversample_rate, 325 mclk_div = sun4i_i2s_get_mclk_div(i2s, clk_rate, i2s->mclk_freq);
327 clk_rate, rate);
328 if (mclk_div < 0) { 326 if (mclk_div < 0) {
329 dev_err(dai->dev, "Unsupported MCLK divider: %d\n", mclk_div); 327 dev_err(dai->dev, "Unsupported MCLK divider: %d\n", mclk_div);
330 return -EINVAL; 328 return -EINVAL;