Home
last modified time | relevance | path

Searched refs:frac (Results 1 – 25 of 41) sorted by relevance

12

/linux-4.19.296/drivers/clk/spear/
Dclk-frac-synth.c47 struct clk_frac *frac = to_clk_frac(hw); in frac_calc_rate() local
48 struct frac_rate_tbl *rtbl = frac->rtbl; in frac_calc_rate()
61 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_round_rate() local
65 frac->rtbl_cnt, &unused); in clk_frac_round_rate()
71 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_recalc_rate() local
75 if (frac->lock) in clk_frac_recalc_rate()
76 spin_lock_irqsave(frac->lock, flags); in clk_frac_recalc_rate()
78 val = readl_relaxed(frac->reg); in clk_frac_recalc_rate()
80 if (frac->lock) in clk_frac_recalc_rate()
81 spin_unlock_irqrestore(frac->lock, flags); in clk_frac_recalc_rate()
[all …]
DMakefile6 obj-y += clk.o clk-aux-synth.o clk-frac-synth.o clk-gpt-synth.o clk-vco-pll.o
/linux-4.19.296/drivers/clk/mxs/
Dclk-frac.c42 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_recalc_rate() local
46 div = readl_relaxed(frac->reg) >> frac->shift; in clk_frac_recalc_rate()
47 div &= (1 << frac->width) - 1; in clk_frac_recalc_rate()
50 return tmp_rate >> frac->width; in clk_frac_recalc_rate()
56 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_round_rate() local
65 tmp <<= frac->width; in clk_frac_round_rate()
73 result = tmp_rate >> frac->width; in clk_frac_round_rate()
74 if ((result << frac->width) < tmp_rate) in clk_frac_round_rate()
82 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_set_rate() local
91 tmp <<= frac->width; in clk_frac_set_rate()
[all …]
Dclk-ref.c58 u8 frac = (readl_relaxed(ref->reg) >> (ref->idx * 8)) & 0x3f; in clk_ref_recalc_rate() local
61 do_div(tmp, frac); in clk_ref_recalc_rate()
71 u8 frac; in clk_ref_round_rate() local
75 frac = tmp; in clk_ref_round_rate()
77 if (frac < 18) in clk_ref_round_rate()
78 frac = 18; in clk_ref_round_rate()
79 else if (frac > 35) in clk_ref_round_rate()
80 frac = 35; in clk_ref_round_rate()
84 do_div(tmp, frac); in clk_ref_round_rate()
96 u8 frac, shift = ref->idx * 8; in clk_ref_set_rate() local
[all …]
DMakefile5 obj-y += clk.o clk-pll.o clk-ref.o clk-div.o clk-frac.o clk-ssp.o
/linux-4.19.296/drivers/clk/imx/
Dclk-pfd.c62 u8 frac = (readl_relaxed(pfd->reg) >> (pfd->idx * 8)) & 0x3f; in clk_pfd_recalc_rate() local
65 do_div(tmp, frac); in clk_pfd_recalc_rate()
74 u8 frac; in clk_pfd_round_rate() local
78 frac = tmp; in clk_pfd_round_rate()
79 if (frac < 12) in clk_pfd_round_rate()
80 frac = 12; in clk_pfd_round_rate()
81 else if (frac > 35) in clk_pfd_round_rate()
82 frac = 35; in clk_pfd_round_rate()
85 do_div(tmp, frac); in clk_pfd_round_rate()
95 u8 frac; in clk_pfd_set_rate() local
[all …]
/linux-4.19.296/drivers/clk/meson/
Dclk-pll.c45 u16 frac, in __pll_params_to_rate() argument
51 if (frac && MESON_PARM_APPLICABLE(&pll->frac)) { in __pll_params_to_rate()
52 u64 frac_rate = (u64)parent_rate * frac; in __pll_params_to_rate()
55 (1 << pll->frac.width)); in __pll_params_to_rate()
67 u16 frac; in meson_clk_pll_recalc_rate() local
81 frac = MESON_PARM_APPLICABLE(&pll->frac) ? in meson_clk_pll_recalc_rate()
82 meson_parm_read(clk->map, &pll->frac) : in meson_clk_pll_recalc_rate()
85 return __pll_params_to_rate(parent_rate, &pllt, frac, pll); in meson_clk_pll_recalc_rate()
93 u16 frac_max = (1 << pll->frac.width); in __pll_params_with_frac()
123 if (MESON_PARM_APPLICABLE(&pll->frac) || in meson_clk_get_pll_settings()
[all …]
Dclk-mpll.c46 uint64_t frac = do_div(div, requested_rate); in params_from_rate() local
48 frac *= SDM_DEN; in params_from_rate()
51 *sdm = DIV_ROUND_CLOSEST_ULL(frac, requested_rate); in params_from_rate()
53 *sdm = DIV_ROUND_UP_ULL(frac, requested_rate); in params_from_rate()
/linux-4.19.296/drivers/clk/rockchip/
Dclk.c149 struct rockchip_clk_frac *frac = to_rockchip_clk_frac_nb(nb); in rockchip_clk_frac_notifier_cb() local
150 struct clk_mux *frac_mux = &frac->mux; in rockchip_clk_frac_notifier_cb()
156 frac->rate_change_idx = in rockchip_clk_frac_notifier_cb()
157 frac->mux_ops->get_parent(&frac_mux->hw); in rockchip_clk_frac_notifier_cb()
158 if (frac->rate_change_idx != frac->mux_frac_idx) { in rockchip_clk_frac_notifier_cb()
159 frac->mux_ops->set_parent(&frac_mux->hw, in rockchip_clk_frac_notifier_cb()
160 frac->mux_frac_idx); in rockchip_clk_frac_notifier_cb()
161 frac->rate_change_remuxed = 1; in rockchip_clk_frac_notifier_cb()
170 if (frac->rate_change_remuxed) { in rockchip_clk_frac_notifier_cb()
171 frac->mux_ops->set_parent(&frac_mux->hw, in rockchip_clk_frac_notifier_cb()
[all …]
Dclk-pll.c157 rate->frac = ((pllcon >> RK3036_PLLCON2_FRAC_SHIFT) in rockchip_rk3036_pll_get_params()
175 u64 frac_rate64 = prate * cur.frac; in rockchip_rk3036_pll_recalc_rate()
200 rate->postdiv2, rate->dsmpd, rate->frac); in rockchip_rk3036_pll_set_params()
229 pllcon |= rate->frac << RK3036_PLLCON2_FRAC_SHIFT; in rockchip_rk3036_pll_set_params()
317 cur.dsmpd, cur.frac); in rockchip_rk3036_pll_init()
320 rate->dsmpd, rate->frac); in rockchip_rk3036_pll_init()
325 (!cur.dsmpd && (rate->frac != cur.frac))) { in rockchip_rk3036_pll_init()
630 rate->frac = ((pllcon >> RK3399_PLLCON2_FRAC_SHIFT) in rockchip_rk3399_pll_get_params()
652 u64 frac_rate64 = prate * cur.frac; in rockchip_rk3399_pll_recalc_rate()
677 rate->postdiv2, rate->dsmpd, rate->frac); in rockchip_rk3399_pll_set_params()
[all …]
/linux-4.19.296/drivers/clk/at91/
Dclk-audio-pll.c87 struct clk_audio_frac *frac = to_clk_audio_frac(hw); in clk_audio_pll_frac_enable() local
89 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_enable()
91 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_enable()
94 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL1, in clk_audio_pll_frac_enable()
95 AT91_PMC_AUDIO_PLL_FRACR_MASK, frac->fracr); in clk_audio_pll_frac_enable()
101 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_enable()
105 AT91_PMC_AUDIO_PLL_ND(frac->nd)); in clk_audio_pll_frac_enable()
137 struct clk_audio_frac *frac = to_clk_audio_frac(hw); in clk_audio_pll_frac_disable() local
139 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_disable()
142 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_disable()
[all …]
/linux-4.19.296/drivers/clk/qcom/
Dclk-rcg2.c400 const struct frac_entry *frac; in clk_edp_pixel_set_rate() local
408 frac = frac_table_810m; in clk_edp_pixel_set_rate()
410 frac = frac_table_675m; in clk_edp_pixel_set_rate()
412 for (; frac->num; frac++) { in clk_edp_pixel_set_rate()
414 request *= frac->den; in clk_edp_pixel_set_rate()
415 request = div_s64(request, frac->num); in clk_edp_pixel_set_rate()
425 f.m = frac->num; in clk_edp_pixel_set_rate()
426 f.n = frac->den; in clk_edp_pixel_set_rate()
446 const struct frac_entry *frac; in clk_edp_pixel_determine_rate() local
458 frac = frac_table_810m; in clk_edp_pixel_determine_rate()
[all …]
Dclk-rcg.c605 const struct frac_entry *frac = pixel_table; in clk_rcg_pixel_determine_rate() local
608 for (; frac->num; frac++) { in clk_rcg_pixel_determine_rate()
609 request = (req->rate * frac->den) / frac->num; in clk_rcg_pixel_determine_rate()
618 req->rate = (src_rate * frac->num) / frac->den; in clk_rcg_pixel_determine_rate()
630 const struct frac_entry *frac = pixel_table; in clk_rcg_pixel_set_rate() local
653 for (; frac->num; frac++) { in clk_rcg_pixel_set_rate()
654 request = (rate * frac->den) / frac->num; in clk_rcg_pixel_set_rate()
660 f.m = frac->num; in clk_rcg_pixel_set_rate()
661 f.n = frac->den; in clk_rcg_pixel_set_rate()
/linux-4.19.296/include/linux/
Dtimecounter.h69 u64 frac; member
80 u64 cycles, u64 mask, u64 *frac) in cyclecounter_cyc2ns() argument
84 ns = (ns * cc->mult) + *frac; in cyclecounter_cyc2ns()
85 *frac = ns & mask; in cyclecounter_cyc2ns()
/linux-4.19.296/drivers/clk/sunxi-ng/
Dccu_mult.c84 if (ccu_frac_helper_is_enabled(&cm->common, &cm->frac)) in ccu_mult_recalc_rate()
85 return ccu_frac_helper_read_rate(&cm->common, &cm->frac); in ccu_mult_recalc_rate()
114 if (ccu_frac_helper_has_rate(&cm->common, &cm->frac, rate)) { in ccu_mult_set_rate()
115 ccu_frac_helper_enable(&cm->common, &cm->frac); in ccu_mult_set_rate()
117 return ccu_frac_helper_set_rate(&cm->common, &cm->frac, in ccu_mult_set_rate()
120 ccu_frac_helper_disable(&cm->common, &cm->frac); in ccu_mult_set_rate()
Dccu_nm.c89 if (ccu_frac_helper_is_enabled(&nm->common, &nm->frac)) { in ccu_nm_recalc_rate()
90 rate = ccu_frac_helper_read_rate(&nm->common, &nm->frac); in ccu_nm_recalc_rate()
139 if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) { in ccu_nm_round_rate()
177 if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) { in ccu_nm_set_rate()
187 ccu_frac_helper_enable(&nm->common, &nm->frac); in ccu_nm_set_rate()
189 return ccu_frac_helper_set_rate(&nm->common, &nm->frac, in ccu_nm_set_rate()
192 ccu_frac_helper_disable(&nm->common, &nm->frac); in ccu_nm_set_rate()
Dccu_nm.h36 struct ccu_frac_internal frac; member
79 .frac = _SUNXI_CCU_FRAC(_frac_en, _frac_sel, \
104 .frac = _SUNXI_CCU_FRAC(_frac_en, _frac_sel, \
Dccu_mult.h39 struct ccu_frac_internal frac; member
/linux-4.19.296/drivers/media/tuners/
Dfc0011.c180 u32 fvco, xin, frac, xdiv, xdivr; in fc0011_set_params() local
218 frac = fvco - xdiv * 18000; in fc0011_set_params()
219 frac = (frac << 15) / 18000; in fc0011_set_params()
220 if (frac >= 16384) in fc0011_set_params()
221 frac += 32786; in fc0011_set_params()
222 if (!frac) in fc0011_set_params()
225 xin = clamp_t(u32, frac, 512, 65024); in fc0011_set_params()
/linux-4.19.296/drivers/media/dvb-frontends/
Dstv6111.c453 u32 p = 1, psel = 0, fvco, div, frac; in set_lof() local
470 frac = fvco % state->ref_freq; in set_lof()
471 frac = muldiv32(frac, 0x40000, state->ref_freq); in set_lof()
493 state->reg[0x05] = (((div >> 8) & 0x01) | ((frac & 0x7F) << 1)) & 0xff; in set_lof()
494 state->reg[0x06] = ((frac >> 7) & 0xFF); in set_lof()
495 state->reg[0x07] = (state->reg[0x07] & ~0x07) | ((frac >> 15) & 0x07); in set_lof()
/linux-4.19.296/drivers/clk/pistachio/
Dclk-pll.c214 vco *= (params->fbdiv << 24) + params->frac; in pll_gf40lp_frac_set_rate()
255 val |= (params->frac << PLL_FRAC_CTRL2_FRAC_SHIFT) | in pll_gf40lp_frac_set_rate()
261 if (params->frac) in pll_gf40lp_frac_set_rate()
276 u64 val, prediv, fbdiv, frac, postdiv1, postdiv2, rate; in pll_gf40lp_frac_recalc_rate() local
287 frac = (val >> PLL_FRAC_CTRL2_FRAC_SHIFT) & PLL_FRAC_CTRL2_FRAC_MASK; in pll_gf40lp_frac_recalc_rate()
292 rate *= (fbdiv << 24) + frac; in pll_gf40lp_frac_recalc_rate()
/linux-4.19.296/include/math-emu/
Dop-1.h79 X##_f = _flo.bits.frac; \
89 X##_f = _flo->bits.frac; \
102 _flo.bits.frac = X##_f; \
114 _flo->bits.frac = X##_f; \
Dsingle.h53 unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0); member
55 unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0);
/linux-4.19.296/drivers/clk/microchip/
Dclk-core.c327 u64 frac; in roclk_calc_div_trim() local
342 frac = 0; in roclk_calc_div_trim()
347 frac = parent_rate; in roclk_calc_div_trim()
348 frac <<= 8; in roclk_calc_div_trim()
349 do_div(frac, rate); in roclk_calc_div_trim()
350 frac -= (u64)(div << 9); in roclk_calc_div_trim()
353 rotrim = (frac >= REFO_TRIM_MAX) ? REFO_TRIM_MAX : frac; in roclk_calc_div_trim()
/linux-4.19.296/drivers/clk/mmp/
DMakefile6 obj-y += clk-apbc.o clk-apmu.o clk-frac.o clk-mix.o clk-gate.o clk.o

12