Lines Matching refs:synth
282 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_enable() local
283 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
285 v &= ~(1 << synth->index); in ti_fapll_synth_enable()
286 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
293 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_disable() local
294 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
296 v |= 1 << synth->index; in ti_fapll_synth_disable()
297 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
302 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_is_enabled() local
303 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_is_enabled()
305 return !(v & (1 << synth->index)); in ti_fapll_synth_is_enabled()
314 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_recalc_rate() local
319 if (!synth->div) in ti_fapll_synth_recalc_rate()
327 if (ti_fapll_clock_is_bypass(synth->fd)) in ti_fapll_synth_recalc_rate()
337 if (synth->freq) { in ti_fapll_synth_recalc_rate()
340 v = readl_relaxed(synth->freq); in ti_fapll_synth_recalc_rate()
350 synth_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_recalc_rate()
358 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_get_frac_rate() local
363 post_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_get_frac_rate()
369 static u32 ti_fapll_synth_set_frac_rate(struct fapll_synth *synth, in ti_fapll_synth_set_frac_rate() argument
397 v = readl_relaxed(synth->freq); in ti_fapll_synth_set_frac_rate()
402 writel_relaxed(v, synth->freq); in ti_fapll_synth_set_frac_rate()
410 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_round_rate() local
411 struct fapll_data *fd = synth->fd; in ti_fapll_synth_round_rate()
414 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_round_rate()
418 if (!synth->freq) { in ti_fapll_synth_round_rate()
444 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_set_rate() local
445 struct fapll_data *fd = synth->fd; in ti_fapll_synth_set_rate()
449 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_set_rate()
455 if (!synth->freq) in ti_fapll_synth_set_rate()
461 if (!synth->freq && !post_rate) in ti_fapll_synth_set_rate()
466 if ((post_rate != rate) && synth->freq) in ti_fapll_synth_set_rate()
467 post_div_m = ti_fapll_synth_set_frac_rate(synth, in ti_fapll_synth_set_rate()
471 v = readl_relaxed(synth->div); in ti_fapll_synth_set_rate()
475 writel_relaxed(v, synth->div); in ti_fapll_synth_set_rate()
498 struct fapll_synth *synth; in ti_fapll_synth_setup() local
509 synth = kzalloc(sizeof(*synth), GFP_KERNEL); in ti_fapll_synth_setup()
510 if (!synth) in ti_fapll_synth_setup()
513 synth->fd = fd; in ti_fapll_synth_setup()
514 synth->index = index; in ti_fapll_synth_setup()
515 synth->freq = freq; in ti_fapll_synth_setup()
516 synth->div = div; in ti_fapll_synth_setup()
517 synth->name = name; in ti_fapll_synth_setup()
518 synth->hw.init = init; in ti_fapll_synth_setup()
519 synth->clk_pll = pll_clk; in ti_fapll_synth_setup()
521 return clk_register(NULL, &synth->hw); in ti_fapll_synth_setup()
524 kfree(synth); in ti_fapll_synth_setup()