Lines Matching refs:ratio

165 static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, bool tx, u32 ratio,  in fsl_esai_divisor_cal()  argument
176 if (ratio > 2 * 8 * 256 * maxfp || ratio < 2) { in fsl_esai_divisor_cal()
180 } else if (ratio % 2) { in fsl_esai_divisor_cal()
185 ratio /= 2; in fsl_esai_divisor_cal()
187 psr = ratio <= 256 * maxfp ? ESAI_xCCR_xPSR_BYPASS : ESAI_xCCR_xPSR_DIV8; in fsl_esai_divisor_cal()
190 if (ratio <= 256) { in fsl_esai_divisor_cal()
191 pm = ratio; in fsl_esai_divisor_cal()
205 if (prod == ratio) in fsl_esai_divisor_cal()
207 else if (prod / ratio == 1) in fsl_esai_divisor_cal()
208 sub = prod - ratio; in fsl_esai_divisor_cal()
209 else if (ratio / prod == 1) in fsl_esai_divisor_cal()
210 sub = ratio - prod; in fsl_esai_divisor_cal()
215 sub = sub * 1000 / ratio; in fsl_esai_divisor_cal()
266 u32 ratio, ecr = 0; in fsl_esai_set_dai_sysclk() local
312 ratio = clk_rate / freq; in fsl_esai_set_dai_sysclk()
313 if (ratio * freq > clk_rate) in fsl_esai_set_dai_sysclk()
314 ret = ratio * freq - clk_rate; in fsl_esai_set_dai_sysclk()
315 else if (ratio * freq < clk_rate) in fsl_esai_set_dai_sysclk()
316 ret = clk_rate - ratio * freq; in fsl_esai_set_dai_sysclk()
328 if (ratio == 1 && clksrc == esai_priv->extalclk) { in fsl_esai_set_dai_sysclk()
332 } else if (ratio < 2) { in fsl_esai_set_dai_sysclk()
339 ret = fsl_esai_divisor_cal(dai, tx, ratio, false, 0); in fsl_esai_set_dai_sysclk()
366 u32 sub, ratio = hck_rate / freq; in fsl_esai_set_bclk() local
373 if (ratio * freq > hck_rate) in fsl_esai_set_bclk()
374 sub = ratio * freq - hck_rate; in fsl_esai_set_bclk()
375 else if (ratio * freq < hck_rate) in fsl_esai_set_bclk()
376 sub = hck_rate - ratio * freq; in fsl_esai_set_bclk()
388 if (!esai_priv->sck_div[tx] && (ratio > 16 || ratio == 0)) { in fsl_esai_set_bclk()
393 ret = fsl_esai_divisor_cal(dai, tx, ratio, true, in fsl_esai_set_bclk()
394 esai_priv->sck_div[tx] ? 0 : ratio); in fsl_esai_set_bclk()