Lines Matching refs:synth

283 	struct fapll_synth *synth = to_synth(hw);  in ti_fapll_synth_enable()  local
284 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
286 v &= ~(1 << synth->index); in ti_fapll_synth_enable()
287 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_enable()
294 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_disable() local
295 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
297 v |= 1 << synth->index; in ti_fapll_synth_disable()
298 writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_disable()
303 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_is_enabled() local
304 u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET); in ti_fapll_synth_is_enabled()
306 return !(v & (1 << synth->index)); in ti_fapll_synth_is_enabled()
315 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_recalc_rate() local
320 if (!synth->div) in ti_fapll_synth_recalc_rate()
328 if (ti_fapll_clock_is_bypass(synth->fd)) in ti_fapll_synth_recalc_rate()
338 if (synth->freq) { in ti_fapll_synth_recalc_rate()
341 v = readl_relaxed(synth->freq); in ti_fapll_synth_recalc_rate()
351 synth_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_recalc_rate()
359 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_get_frac_rate() local
364 post_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M; in ti_fapll_synth_get_frac_rate()
370 static u32 ti_fapll_synth_set_frac_rate(struct fapll_synth *synth, in ti_fapll_synth_set_frac_rate() argument
398 v = readl_relaxed(synth->freq); in ti_fapll_synth_set_frac_rate()
403 writel_relaxed(v, synth->freq); in ti_fapll_synth_set_frac_rate()
411 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_round_rate() local
412 struct fapll_data *fd = synth->fd; in ti_fapll_synth_round_rate()
415 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_round_rate()
419 if (!synth->freq) { in ti_fapll_synth_round_rate()
445 struct fapll_synth *synth = to_synth(hw); in ti_fapll_synth_set_rate() local
446 struct fapll_data *fd = synth->fd; in ti_fapll_synth_set_rate()
450 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_set_rate()
456 if (!synth->freq) in ti_fapll_synth_set_rate()
462 if (!synth->freq && !post_rate) in ti_fapll_synth_set_rate()
467 if ((post_rate != rate) && synth->freq) in ti_fapll_synth_set_rate()
468 post_div_m = ti_fapll_synth_set_frac_rate(synth, in ti_fapll_synth_set_rate()
472 v = readl_relaxed(synth->div); in ti_fapll_synth_set_rate()
476 writel_relaxed(v, synth->div); in ti_fapll_synth_set_rate()
499 struct fapll_synth *synth; in ti_fapll_synth_setup() local
510 synth = kzalloc(sizeof(*synth), GFP_KERNEL); in ti_fapll_synth_setup()
511 if (!synth) in ti_fapll_synth_setup()
514 synth->fd = fd; in ti_fapll_synth_setup()
515 synth->index = index; in ti_fapll_synth_setup()
516 synth->freq = freq; in ti_fapll_synth_setup()
517 synth->div = div; in ti_fapll_synth_setup()
518 synth->name = name; in ti_fapll_synth_setup()
519 synth->hw.init = init; in ti_fapll_synth_setup()
520 synth->clk_pll = pll_clk; in ti_fapll_synth_setup()
522 return clk_register(NULL, &synth->hw); in ti_fapll_synth_setup()
525 kfree(synth); in ti_fapll_synth_setup()