Lines Matching refs:div
127 static bool fsl_asrc_divider_avail(int clk_rate, int rate, int *div) in fsl_asrc_divider_avail() argument
132 if (div) in fsl_asrc_divider_avail()
133 *div = 0; in fsl_asrc_divider_avail()
141 if (div) in fsl_asrc_divider_avail()
142 *div = n; in fsl_asrc_divider_avail()
304 static u32 fsl_asrc_cal_asrck_divisor(struct fsl_asrc_pair *pair, u32 div) in fsl_asrc_cal_asrck_divisor() argument
309 for (ps = 0; div > 8; ps++) in fsl_asrc_cal_asrck_divisor()
310 div >>= 1; in fsl_asrc_cal_asrck_divisor()
312 return ((div - 1) << ASRCDRi_AxCPi_WIDTH) | ps; in fsl_asrc_cal_asrck_divisor()
387 u32 clk_index[2], div[2]; in fsl_asrc_config_pair() local
472 div_avail = fsl_asrc_divider_avail(clk_rate, inrate, &div[IN]); in fsl_asrc_config_pair()
481 if (div[IN] == 0 || (!ideal && !div_avail)) { in fsl_asrc_config_pair()
487 div[IN] = min_t(u32, 1024, div[IN]); in fsl_asrc_config_pair()
492 div_avail = fsl_asrc_divider_avail(clk_rate, IDEAL_RATIO_RATE, &div[OUT]); in fsl_asrc_config_pair()
494 div_avail = fsl_asrc_divider_avail(clk_rate, outrate, &div[OUT]); in fsl_asrc_config_pair()
497 if (div[OUT] == 0 || (!ideal && !div_avail)) { in fsl_asrc_config_pair()
503 div[OUT] = min_t(u32, 1024, div[OUT]); in fsl_asrc_config_pair()
529 indiv = fsl_asrc_cal_asrck_divisor(pair, div[IN]); in fsl_asrc_config_pair()
530 outdiv = fsl_asrc_cal_asrck_divisor(pair, div[OUT]); in fsl_asrc_config_pair()