Lines Matching refs:synth

284 	struct fapll_synth *synth = to_synth(hw);  in ti_fapll_synth_enable()  local
285 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
287 v &= ~(1 << synth->index); in ti_fapll_synth_enable()
288 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
295 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_disable() local
296 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
298 v |= 1 << synth->index; in ti_fapll_synth_disable()
299 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
304 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_is_enabled() local
305 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_is_enabled()
307 return !(v & (1 << synth->index)); in ti_fapll_synth_is_enabled()
316 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_recalc_rate() local
321 if (!synth->div) in ti_fapll_synth_recalc_rate()
329 if (ti_fapll_clock_is_bypass(synth->fd)) in ti_fapll_synth_recalc_rate()
339 if (synth->freq) { in ti_fapll_synth_recalc_rate()
342 v = readl_relaxed(synth->freq); in ti_fapll_synth_recalc_rate()
352 synth_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_recalc_rate()
360 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_get_frac_rate() local
365 post_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_get_frac_rate()
371 static u32 ti_fapll_synth_set_frac_rate(struct fapll_synth *synth, in ti_fapll_synth_set_frac_rate() argument
399 v = readl_relaxed(synth->freq); in ti_fapll_synth_set_frac_rate()
404 writel_relaxed(v, synth->freq); in ti_fapll_synth_set_frac_rate()
412 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_round_rate() local
413 struct fapll_data *fd = synth->fd; in ti_fapll_synth_round_rate()
416 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_round_rate()
420 if (!synth->freq) { in ti_fapll_synth_round_rate()
446 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_set_rate() local
447 struct fapll_data *fd = synth->fd; in ti_fapll_synth_set_rate()
451 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_set_rate()
457 if (!synth->freq) in ti_fapll_synth_set_rate()
463 if (!synth->freq && !post_rate) in ti_fapll_synth_set_rate()
468 if ((post_rate != rate) && synth->freq) in ti_fapll_synth_set_rate()
469 post_div_m = ti_fapll_synth_set_frac_rate(synth, in ti_fapll_synth_set_rate()
473 v = readl_relaxed(synth->div); in ti_fapll_synth_set_rate()
477 writel_relaxed(v, synth->div); in ti_fapll_synth_set_rate()
500 struct fapll_synth *synth; in ti_fapll_synth_setup() local
512 synth = kzalloc(sizeof(*synth), GFP_KERNEL); in ti_fapll_synth_setup()
513 if (!synth) in ti_fapll_synth_setup()
516 synth->fd = fd; in ti_fapll_synth_setup()
517 synth->index = index; in ti_fapll_synth_setup()
518 synth->freq = freq; in ti_fapll_synth_setup()
519 synth->div = div; in ti_fapll_synth_setup()
520 synth->name = name; in ti_fapll_synth_setup()
521 synth->hw.init = init; in ti_fapll_synth_setup()
522 synth->clk_pll = pll_clk; in ti_fapll_synth_setup()
524 clk = clk_register(NULL, &synth->hw); in ti_fapll_synth_setup()
533 kfree(synth); in ti_fapll_synth_setup()