Home
last modified time | relevance | path

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

123

/Linux-v4.19/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 …]
/Linux-v4.19/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 …]
/Linux-v4.19/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-v4.19/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-v4.19/arch/sh/kernel/cpu/sh2a/
Dfpu.c205 int frac; in denormal_subf1() local
218 frac = (ix & 0x007fffff) | 0x00800000; in denormal_subf1()
219 frac -= iy; in denormal_subf1()
220 while (frac < 0x00800000) { in denormal_subf1()
222 return frac; in denormal_subf1()
223 frac <<= 1; in denormal_subf1()
226 return (exp << 23) | (frac & 0x007fffff); in denormal_subf1()
232 int frac; in denormal_addf1() local
245 frac = (ix & 0x007fffff) | 0x00800000; in denormal_addf1()
246 frac += iy; in denormal_addf1()
[all …]
/Linux-v4.19/kernel/time/
Dtimecounter.c29 tc->frac = 0; in timecounter_init()
57 tc->mask, &tc->frac); in timecounter_read_delta()
83 u64 cycles, u64 mask, u64 frac) in cc_cyc2ns_backwards() argument
87 ns = ((ns * cc->mult) - frac) >> cc->shift; in cc_cyc2ns_backwards()
96 u64 nsec = tc->nsec, frac = tc->frac; in timecounter_cyc2time() local
105 nsec -= cc_cyc2ns_backwards(tc->cc, delta, tc->mask, frac); in timecounter_cyc2time()
107 nsec += cyclecounter_cyc2ns(tc->cc, delta, tc->mask, &frac); in timecounter_cyc2time()
/Linux-v4.19/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-v4.19/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-v4.19/drivers/clk/qcom/
Dclk-rcg2.c395 const struct frac_entry *frac; in clk_edp_pixel_set_rate() local
403 frac = frac_table_810m; in clk_edp_pixel_set_rate()
405 frac = frac_table_675m; in clk_edp_pixel_set_rate()
407 for (; frac->num; frac++) { in clk_edp_pixel_set_rate()
409 request *= frac->den; in clk_edp_pixel_set_rate()
410 request = div_s64(request, frac->num); in clk_edp_pixel_set_rate()
420 f.m = frac->num; in clk_edp_pixel_set_rate()
421 f.n = frac->den; in clk_edp_pixel_set_rate()
441 const struct frac_entry *frac; in clk_edp_pixel_determine_rate() local
453 frac = frac_table_810m; in clk_edp_pixel_determine_rate()
[all …]
/Linux-v4.19/drivers/gpu/drm/meson/
Dmeson_vclk.c425 unsigned int frac, unsigned int od1, in meson_hdmi_pll_set_params() argument
432 if (frac) in meson_hdmi_pll_set_params()
434 0x00004000 | frac); in meson_hdmi_pll_set_params()
453 regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL2, 0x800cb000 | frac); in meson_hdmi_pll_set_params()
518 unsigned int frac; in meson_hdmi_pll_get_frac() local
531 frac = div_u64((u64)pll_freq * (u64)frac_max, parent_freq); in meson_hdmi_pll_get_frac()
533 if (frac_m > frac) in meson_hdmi_pll_get_frac()
535 frac -= frac_m; in meson_hdmi_pll_get_frac()
537 return min((u16)frac, (u16)(frac_max - 1)); in meson_hdmi_pll_get_frac()
542 unsigned int frac) in meson_hdmi_pll_validate_params() argument
[all …]
/Linux-v4.19/drivers/phy/st/
Dphy-stm32-usbphyc.c55 u16 frac; member
89 unsigned long long fvco, ndiv, frac; in stm32_usbphyc_get_pll_params() local
107 frac = fvco * (1 << 16); in stm32_usbphyc_get_pll_params()
108 do_div(frac, (clk_rate * 2)); in stm32_usbphyc_get_pll_params()
109 frac = frac - (ndiv * (1 << 16)); in stm32_usbphyc_get_pll_params()
110 pll_params->frac = (u16)frac; in stm32_usbphyc_get_pll_params()
117 u32 ndiv, frac; in stm32_usbphyc_pll_init() local
129 frac = FIELD_PREP(PLLFRACIN, pll_params.frac); in stm32_usbphyc_pll_init()
133 if (pll_params.frac) in stm32_usbphyc_pll_init()
134 usbphyc_pll |= PLLFRACCTL | frac; in stm32_usbphyc_pll_init()
/Linux-v4.19/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-v4.19/arch/mips/ath79/
Dclock.c223 u32 frac, u32 out_div) in ar934x_get_pll_freq() argument
235 do_div(t, ref_div * frac); in ar934x_get_pll_freq()
248 u32 pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv; in ar934x_clocks_init() local
271 frac = 1 << 18; in ar934x_clocks_init()
282 frac = 1 << 6; in ar934x_clocks_init()
286 nfrac, frac, out_div); in ar934x_clocks_init()
298 frac = 1 << 18; in ar934x_clocks_init()
309 frac = 1 << 10; in ar934x_clocks_init()
313 nfrac, frac, out_div); in ar934x_clocks_init()
364 u32 pll, out_div, ref_div, nint, frac, clk_ctrl, postdiv; in qca953x_clocks_init() local
[all …]
/Linux-v4.19/Documentation/media/uapi/v4l/
Dcolorspaces-details.rst64 L = -\left( \frac{L' - 0.099}{-1.099} \right) ^{\frac{1}{0.45}} \text{, for } L' \le -0.081
66 L = \frac{L'}{4.5} \text{, for } -0.081 < L' < 0.081
68 L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081
144 L = -\left( \frac{L' - 0.099}{-1.099} \right)^\frac{1}{0.45} \text{, for } L' \le -0.081
146 L = \frac{L'}{4.5}\text{, for } -0.081 < L' < 0.081
148 L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081
181 Y' = \frac{219}{256} * (0.2126R' + 0.7152G' + 0.0722B') + \frac{16}{256}
183 Cb = \frac{224}{256} * (-0.1146R' - 0.3854G' + 0.5B')
185 Cr = \frac{224}{256} * (0.5R' - 0.4542G' - 0.0458B')
194 Y' = \frac{219}{256} * (0.2990R' + 0.5870G' + 0.1140B') + \frac{16}{256}
[all …]
/Linux-v4.19/arch/powerpc/kernel/
Dvecemu.c41 unsigned int mant, frac; in eexp2() local
75 asm("mulhwu %0,%1,%2" : "=r" (frac) in eexp2()
77 asm("mulhwu %0,%1,%2" : "=r" (frac) : "r" (frac), "r" (mant)); in eexp2()
78 mant += frac; in eexp2()
95 int exp, mant, lz, frac; in elog2() local
135 asm("mulhwu %0,%1,%2" : "=r" (frac) in elog2()
137 exp += frac; in elog2()
/Linux-v4.19/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.c77 if (ccu_frac_helper_is_enabled(&nm->common, &nm->frac)) { in ccu_nm_recalc_rate()
78 rate = ccu_frac_helper_read_rate(&nm->common, &nm->frac); in ccu_nm_recalc_rate()
127 if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) { in ccu_nm_round_rate()
165 if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) { in ccu_nm_set_rate()
175 ccu_frac_helper_enable(&nm->common, &nm->frac); in ccu_nm_set_rate()
177 return ccu_frac_helper_set_rate(&nm->common, &nm->frac, in ccu_nm_set_rate()
180 ccu_frac_helper_disable(&nm->common, &nm->frac); in ccu_nm_set_rate()
/Linux-v4.19/drivers/hwmon/
Dstts751.c160 s32 integer1, integer2, frac; in stts751_update_temp() local
180 frac = i2c_smbus_read_byte_data(priv->client, STTS751_REG_TEMP_L); in stts751_update_temp()
181 if (frac < 0) { in stts751_update_temp()
183 "I2C read failed (temp L). ret: %x\n", frac); in stts751_update_temp()
184 return frac; in stts751_update_temp()
195 frac = i2c_smbus_read_byte_data(priv->client, in stts751_update_temp()
197 if (frac < 0) { in stts751_update_temp()
200 frac); in stts751_update_temp()
201 return frac; in stts751_update_temp()
205 priv->temp = stts751_to_deg((integer1 << 8) | frac); in stts751_update_temp()
[all …]
/Linux-v4.19/kernel/locking/
Dqspinlock_stat.h139 u64 frac = 0; in qstat_read() local
142 frac = 100ULL * do_div(stat, kicks); in qstat_read()
143 frac = DIV_ROUND_CLOSEST_ULL(frac, kicks); in qstat_read()
149 len = snprintf(buf, sizeof(buf) - 1, "%llu.%02llu\n", stat, frac); in qstat_read()
/Linux-v4.19/drivers/gpu/drm/msm/dsi/pll/
Ddsi_pll_10nm.c156 u32 frac; in dsi_pll_calc_dec_frac() local
168 div_u64_rem(dec_multiple, multiplier, &frac); in dsi_pll_calc_dec_frac()
185 regs->frac_div_start_low = (frac & 0xff); in dsi_pll_calc_dec_frac()
186 regs->frac_div_start_mid = (frac & 0xff00) >> 8; in dsi_pll_calc_dec_frac()
187 regs->frac_div_start_high = (frac & 0x30000) >> 16; in dsi_pll_calc_dec_frac()
200 u64 frac; in dsi_pll_calc_ssc() local
211 frac = regs->frac_div_start_low | in dsi_pll_calc_ssc()
216 ssc_step_size += frac; in dsi_pll_calc_ssc()
232 regs->decimal_div_start, frac, config->frac_bits); in dsi_pll_calc_ssc()
477 u32 frac; in dsi_pll_10nm_vco_recalc_rate() local
[all …]
/Linux-v4.19/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-v4.19/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()

123