Lines Matching refs:synth

277 	struct fapll_synth *synth = to_synth(hw);  in ti_fapll_synth_enable()  local
278 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
280 v &= ~(1 << synth->index); in ti_fapll_synth_enable()
281 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
288 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_disable() local
289 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
291 v |= 1 << synth->index; in ti_fapll_synth_disable()
292 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
297 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_is_enabled() local
298 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_is_enabled()
300 return !(v & (1 << synth->index)); in ti_fapll_synth_is_enabled()
309 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_recalc_rate() local
314 if (!synth->div) in ti_fapll_synth_recalc_rate()
322 if (ti_fapll_clock_is_bypass(synth->fd)) in ti_fapll_synth_recalc_rate()
332 if (synth->freq) { in ti_fapll_synth_recalc_rate()
335 v = readl_relaxed(synth->freq); in ti_fapll_synth_recalc_rate()
345 synth_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_recalc_rate()
353 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_get_frac_rate() local
358 post_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_get_frac_rate()
364 static u32 ti_fapll_synth_set_frac_rate(struct fapll_synth *synth, in ti_fapll_synth_set_frac_rate() argument
392 v = readl_relaxed(synth->freq); in ti_fapll_synth_set_frac_rate()
397 writel_relaxed(v, synth->freq); in ti_fapll_synth_set_frac_rate()
405 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_round_rate() local
406 struct fapll_data *fd = synth->fd; in ti_fapll_synth_round_rate()
409 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_round_rate()
413 if (!synth->freq) { in ti_fapll_synth_round_rate()
439 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_set_rate() local
440 struct fapll_data *fd = synth->fd; in ti_fapll_synth_set_rate()
444 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_set_rate()
450 if (!synth->freq) in ti_fapll_synth_set_rate()
456 if (!synth->freq && !post_rate) in ti_fapll_synth_set_rate()
461 if ((post_rate != rate) && synth->freq) in ti_fapll_synth_set_rate()
462 post_div_m = ti_fapll_synth_set_frac_rate(synth, in ti_fapll_synth_set_rate()
466 v = readl_relaxed(synth->div); in ti_fapll_synth_set_rate()
470 writel_relaxed(v, synth->div); in ti_fapll_synth_set_rate()
493 struct fapll_synth *synth; in ti_fapll_synth_setup() local
505 synth = kzalloc(sizeof(*synth), GFP_KERNEL); in ti_fapll_synth_setup()
506 if (!synth) in ti_fapll_synth_setup()
509 synth->fd = fd; in ti_fapll_synth_setup()
510 synth->index = index; in ti_fapll_synth_setup()
511 synth->freq = freq; in ti_fapll_synth_setup()
512 synth->div = div; in ti_fapll_synth_setup()
513 synth->name = name; in ti_fapll_synth_setup()
514 synth->hw.init = init; in ti_fapll_synth_setup()
515 synth->clk_pll = pll_clk; in ti_fapll_synth_setup()
517 clk = clk_register(NULL, &synth->hw); in ti_fapll_synth_setup()
526 kfree(synth); in ti_fapll_synth_setup()