Lines Matching refs:div_factor
511 u32 div_factor = hsdk_idiv_read(clk); in idiv_get() local
513 div_factor &= CGU_IDIV_MASK; in idiv_get()
515 pr_debug("current configurarion: %#x (%d)\n", div_factor, div_factor); in idiv_get()
517 if (div_factor == 0) in idiv_get()
520 return parent_rate / div_factor; in idiv_get()
615 u32 div_factor; in idiv_set() local
617 div_factor = parent_rate / rate; in idiv_set()
618 if (abs(rate - parent_rate / (div_factor + 1)) <= in idiv_set()
619 abs(rate - parent_rate / div_factor)) { in idiv_set()
620 div_factor += 1; in idiv_set()
623 if (div_factor & ~CGU_IDIV_MASK) { in idiv_set()
625 rate, parent_rate, div_factor, CGU_IDIV_MASK); in idiv_set()
627 div_factor = CGU_IDIV_MASK; in idiv_set()
630 if (div_factor == 0) { in idiv_set()
632 rate, parent_rate, div_factor); in idiv_set()
634 div_factor = 1; in idiv_set()
637 hsdk_idiv_write(clk, div_factor); in idiv_set()