Lines Matching refs:sample_cnt
445 unsigned int sample_cnt; in mtk_i2c_calculate_speed() local
472 for (sample_cnt = 1; sample_cnt <= MAX_SAMPLE_CNT_DIV; sample_cnt++) { in mtk_i2c_calculate_speed()
473 step_cnt = DIV_ROUND_UP(opt_div, sample_cnt); in mtk_i2c_calculate_speed()
474 cnt_mul = step_cnt * sample_cnt; in mtk_i2c_calculate_speed()
480 base_sample_cnt = sample_cnt; in mtk_i2c_calculate_speed()
487 sample_cnt = base_sample_cnt; in mtk_i2c_calculate_speed()
490 if ((clk_src / (2 * sample_cnt * step_cnt)) > target_speed) { in mtk_i2c_calculate_speed()
499 *timing_sample_cnt = sample_cnt - 1; in mtk_i2c_calculate_speed()
508 unsigned int sample_cnt; in mtk_i2c_set_speed() local
528 &step_cnt, &sample_cnt); in mtk_i2c_set_speed()
533 (sample_cnt << 12) | (step_cnt << 8); in mtk_i2c_set_speed()
537 (sample_cnt << 12) | (step_cnt << 9); in mtk_i2c_set_speed()
540 &step_cnt, &sample_cnt); in mtk_i2c_set_speed()
544 i2c->timing_reg = (sample_cnt << 8) | step_cnt; in mtk_i2c_set_speed()
550 i2c->ltiming_reg = (sample_cnt << 6) | step_cnt; in mtk_i2c_set_speed()