Lines Matching refs:synth
286 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_enable() local
287 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
289 v &= ~(1 << synth->index); in ti_fapll_synth_enable()
290 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
297 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_disable() local
298 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
300 v |= 1 << synth->index; in ti_fapll_synth_disable()
301 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
306 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_is_enabled() local
307 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_is_enabled()
309 return !(v & (1 << synth->index)); in ti_fapll_synth_is_enabled()
318 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_recalc_rate() local
323 if (!synth->div) in ti_fapll_synth_recalc_rate()
331 if (ti_fapll_clock_is_bypass(synth->fd)) in ti_fapll_synth_recalc_rate()
341 if (synth->freq) { in ti_fapll_synth_recalc_rate()
344 v = readl_relaxed(synth->freq); in ti_fapll_synth_recalc_rate()
354 synth_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_recalc_rate()
362 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_get_frac_rate() local
367 post_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_get_frac_rate()
373 static u32 ti_fapll_synth_set_frac_rate(struct fapll_synth *synth, in ti_fapll_synth_set_frac_rate() argument
401 v = readl_relaxed(synth->freq); in ti_fapll_synth_set_frac_rate()
406 writel_relaxed(v, synth->freq); in ti_fapll_synth_set_frac_rate()
414 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_round_rate() local
415 struct fapll_data *fd = synth->fd; in ti_fapll_synth_round_rate()
418 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_round_rate()
422 if (!synth->freq) { in ti_fapll_synth_round_rate()
448 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_set_rate() local
449 struct fapll_data *fd = synth->fd; in ti_fapll_synth_set_rate()
453 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_set_rate()
459 if (!synth->freq) in ti_fapll_synth_set_rate()
465 if (!synth->freq && !post_rate) in ti_fapll_synth_set_rate()
470 if ((post_rate != rate) && synth->freq) in ti_fapll_synth_set_rate()
471 post_div_m = ti_fapll_synth_set_frac_rate(synth, in ti_fapll_synth_set_rate()
475 v = readl_relaxed(synth->div); in ti_fapll_synth_set_rate()
479 writel_relaxed(v, synth->div); in ti_fapll_synth_set_rate()
502 struct fapll_synth *synth; in ti_fapll_synth_setup() local
514 synth = kzalloc(sizeof(*synth), GFP_KERNEL); in ti_fapll_synth_setup()
515 if (!synth) in ti_fapll_synth_setup()
518 synth->fd = fd; in ti_fapll_synth_setup()
519 synth->index = index; in ti_fapll_synth_setup()
520 synth->freq = freq; in ti_fapll_synth_setup()
521 synth->div = div; in ti_fapll_synth_setup()
522 synth->name = name; in ti_fapll_synth_setup()
523 synth->hw.init = init; in ti_fapll_synth_setup()
524 synth->clk_pll = pll_clk; in ti_fapll_synth_setup()
526 clk = clk_register(NULL, &synth->hw); in ti_fapll_synth_setup()
535 kfree(synth); in ti_fapll_synth_setup()