/linux/drivers/clk/spear/ |
H A D | clk-frac-synth.c | 44 struct clk_frac *frac = to_clk_frac(hw); in frac_calc_rate() local 45 struct frac_rate_tbl *rtbl = frac->rtbl; in frac_calc_rate() 58 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_round_rate() local 62 frac->rtbl_cnt, &unused); in clk_frac_round_rate() 68 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_recalc_rate() local 72 if (frac->lock) in clk_frac_recalc_rate() 73 spin_lock_irqsave(frac->lock, flags); in clk_frac_recalc_rate() 75 val = readl_relaxed(frac->reg); in clk_frac_recalc_rate() 77 if (frac->lock) in clk_frac_recalc_rate() 78 spin_unlock_irqrestore(frac->lock, flags); in clk_frac_recalc_rate() [all …]
|
/linux/drivers/clk/mxs/ |
H A D | clk-frac.c | 36 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_recalc_rate() local 40 div = readl_relaxed(frac->reg) >> frac->shift; in clk_frac_recalc_rate() 41 div &= (1 << frac->width) - 1; in clk_frac_recalc_rate() 44 return tmp_rate >> frac->width; in clk_frac_recalc_rate() 50 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_round_rate() local 59 tmp <<= frac->width; in clk_frac_round_rate() 67 result = tmp_rate >> frac->width; in clk_frac_round_rate() 68 if ((result << frac->width) < tmp_rate) in clk_frac_round_rate() 76 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_set_rate() local 85 tmp <<= frac->width; in clk_frac_set_rate() [all …]
|
H A D | clk-ref.c | 52 u8 frac = (readl_relaxed(ref->reg) >> (ref->idx * 8)) & 0x3f; in clk_ref_recalc_rate() local 55 do_div(tmp, frac); in clk_ref_recalc_rate() 65 u8 frac; in clk_ref_round_rate() local 69 frac = clamp(tmp, 18, 35); in clk_ref_round_rate() 73 do_div(tmp, frac); in clk_ref_round_rate() 85 u8 frac, shift = ref->idx * 8; in clk_ref_set_rate() local 89 frac = clamp(tmp, 18, 35); in clk_ref_set_rate() 95 val |= frac << shift; in clk_ref_set_rate()
|
/linux/drivers/clk/imx/ |
H A D | clk-pfd.c | 57 u8 frac = (readl_relaxed(pfd->reg) >> (pfd->idx * 8)) & 0x3f; in clk_pfd_recalc_rate() local 60 do_div(tmp, frac); in clk_pfd_recalc_rate() 69 u8 frac; in clk_pfd_round_rate() local 73 frac = tmp; in clk_pfd_round_rate() 74 if (frac < 12) in clk_pfd_round_rate() 75 frac = 12; in clk_pfd_round_rate() 76 else if (frac > 35) in clk_pfd_round_rate() 77 frac = 35; in clk_pfd_round_rate() 80 do_div(tmp, frac); in clk_pfd_round_rate() 90 u8 frac; in clk_pfd_set_rate() local [all …]
|
H A D | clk-pfdv2.c | 84 u8 frac; in clk_pfdv2_recalc_rate() local 86 frac = (readl_relaxed(pfd->reg) >> pfd->frac_off) in clk_pfdv2_recalc_rate() 89 if (!frac) { in clk_pfdv2_recalc_rate() 96 do_div(tmp, frac); in clk_pfdv2_recalc_rate() 112 u8 frac; in clk_pfdv2_determine_rate() local 119 frac = tmp; in clk_pfdv2_determine_rate() 121 if (frac < 12) in clk_pfdv2_determine_rate() 122 frac = 12; in clk_pfdv2_determine_rate() 123 else if (frac > 35) in clk_pfdv2_determine_rate() 124 frac = 35; in clk_pfdv2_determine_rate() [all …]
|
/linux/drivers/clk/at91/ |
H A D | clk-sam9x60-pll.c | 40 u32 frac; member 75 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_recalc_rate() local 78 freq = parent_rate * (frac->mul + 1) + in sam9x60_frac_pll_recalc_rate() 79 DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22)); in sam9x60_frac_pll_recalc_rate() 89 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_set() local 103 (cmul == frac->mul && cfrac == frac->frac)) in sam9x60_frac_pll_set() 114 (frac->mul << core->layout->mul_shift) | in sam9x60_frac_pll_set() 115 (frac->frac << core->layout->frac_shift)); in sam9x60_frac_pll_set() 195 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_compute_mul_frac() local 226 frac->mul = nmul - 1; in sam9x60_frac_pll_compute_mul_frac() [all …]
|
H A D | clk-audio-pll.c | 84 struct clk_audio_frac *frac = to_clk_audio_frac(hw); in clk_audio_pll_frac_enable() local 86 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_enable() 88 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_enable() 91 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL1, in clk_audio_pll_frac_enable() 92 AT91_PMC_AUDIO_PLL_FRACR_MASK, frac->fracr); in clk_audio_pll_frac_enable() 98 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_enable() 102 AT91_PMC_AUDIO_PLL_ND(frac->nd)); in clk_audio_pll_frac_enable() 134 struct clk_audio_frac *frac = to_clk_audio_frac(hw); in clk_audio_pll_frac_disable() local 136 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_disable() 139 regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0, in clk_audio_pll_frac_disable() [all …]
|
/linux/arch/sh/kernel/cpu/sh2a/ |
H A D | fpu.c | 202 int frac; in denormal_subf1() local 215 frac = (ix & 0x007fffff) | 0x00800000; in denormal_subf1() 216 frac -= iy; in denormal_subf1() 217 while (frac < 0x00800000) { in denormal_subf1() 219 return frac; in denormal_subf1() 220 frac <<= 1; in denormal_subf1() 223 return (exp << 23) | (frac & 0x007fffff); in denormal_subf1() 229 int frac; in denormal_addf1() local 242 frac = (ix & 0x007fffff) | 0x00800000; in denormal_addf1() 243 frac += iy; in denormal_addf1() [all …]
|
/linux/drivers/clk/meson/ |
H A D | clk-pll.c | 48 !MESON_PARM_APPLICABLE(&pll->frac)) in __pll_round_closest_mult() 56 unsigned int frac, in __pll_params_to_rate() argument 61 (1 << pll->frac.width); in __pll_params_to_rate() 63 if (frac && MESON_PARM_APPLICABLE(&pll->frac)) { in __pll_params_to_rate() 64 u64 frac_rate = (u64)parent_rate * frac; in __pll_params_to_rate() 77 unsigned int m, n, frac; in meson_clk_pll_recalc_rate() local 91 frac = MESON_PARM_APPLICABLE(&pll->frac) ? in meson_clk_pll_recalc_rate() 92 meson_parm_read(clk->map, &pll->frac) : in meson_clk_pll_recalc_rate() 95 return __pll_params_to_rate(parent_rate, m, n, frac, pll); in meson_clk_pll_recalc_rate() 105 (1 << pll->frac.width); in __pll_params_with_frac() [all …]
|
/linux/drivers/gpu/drm/meson/ |
H A D | meson_vclk.c | 491 unsigned int frac, unsigned int od1, in meson_hdmi_pll_set_params() argument 498 if (frac) in meson_hdmi_pll_set_params() 500 0x00004000 | frac); in meson_hdmi_pll_set_params() 519 regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL2, 0x800cb000 | frac); in meson_hdmi_pll_set_params() 542 regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL2, frac); in meson_hdmi_pll_set_params() 547 if (frac < 0x10000) { in meson_hdmi_pll_set_params() 643 unsigned int frac; in meson_hdmi_pll_get_frac() local 659 frac = div_u64((u64)pll_freq * (u64)frac_max, parent_freq); in meson_hdmi_pll_get_frac() 661 if (frac_m > frac) in meson_hdmi_pll_get_frac() 663 frac -= frac_m; in meson_hdmi_pll_get_frac() [all …]
|
/linux/drivers/clk/rockchip/ |
H A D | clk.c | 145 struct rockchip_clk_frac *frac = to_rockchip_clk_frac_nb(nb); in rockchip_clk_frac_notifier_cb() local 146 struct clk_mux *frac_mux = &frac->mux; in rockchip_clk_frac_notifier_cb() 152 frac->rate_change_idx = in rockchip_clk_frac_notifier_cb() 153 frac->mux_ops->get_parent(&frac_mux->hw); in rockchip_clk_frac_notifier_cb() 154 if (frac->rate_change_idx != frac->mux_frac_idx) { in rockchip_clk_frac_notifier_cb() 155 frac->mux_ops->set_parent(&frac_mux->hw, in rockchip_clk_frac_notifier_cb() 156 frac->mux_frac_idx); in rockchip_clk_frac_notifier_cb() 157 frac->rate_change_remuxed = 1; in rockchip_clk_frac_notifier_cb() 166 if (frac->rate_change_remuxed) { in rockchip_clk_frac_notifier_cb() 167 frac->mux_ops->set_parent(&frac_mux->hw, in rockchip_clk_frac_notifier_cb() [all …]
|
/linux/kernel/time/ |
H A D | timecounter.c | 16 tc->frac = 0; in timecounter_init() 44 tc->mask, &tc->frac); in timecounter_read_delta() 70 u64 cycles, u64 mask, u64 frac) in cc_cyc2ns_backwards() argument 74 ns = ((ns * cc->mult) - frac) >> cc->shift; in cc_cyc2ns_backwards() 83 u64 nsec = tc->nsec, frac = tc->frac; in timecounter_cyc2time() local 92 nsec -= cc_cyc2ns_backwards(tc->cc, delta, tc->mask, frac); in timecounter_cyc2time() 94 nsec += cyclecounter_cyc2ns(tc->cc, delta, tc->mask, &frac); in timecounter_cyc2time()
|
/linux/drivers/net/ethernet/marvell/mvpp2/ |
H A D | mvpp2_tai.c | 104 static void mvpp2_tai_write_tlv(const struct timespec64 *ts, u32 frac, in mvpp2_tai_write_tlv() argument 112 mvpp2_tai_write(frac >> 16, base + MVPP22_TAI_TLV_FRAC_HIGH); in mvpp2_tai_write_tlv() 113 mvpp2_tai_write(frac, base + MVPP22_TAI_TLV_FRAC_LOW); in mvpp2_tai_write_tlv() 170 s32 frac; in mvpp22_tai_adjfine() local 187 frac = -val; in mvpp22_tai_adjfine() 192 frac = val; in mvpp22_tai_adjfine() 197 mvpp2_tai_write(frac >> 16, base + MVPP22_TAI_TLV_FRAC_HIGH); in mvpp22_tai_adjfine() 198 mvpp2_tai_write(frac, base + MVPP22_TAI_TLV_FRAC_LOW); in mvpp22_tai_adjfine() 314 u32 nano, frac; in mvpp22_tai_set_step() local 317 frac = lower_32_bits(tai->period); in mvpp22_tai_set_step() [all …]
|
/linux/arch/mips/ath79/ |
H A D | clock.c | 213 u32 frac, u32 out_div) in ar934x_get_pll_freq() argument 225 do_div(t, ref_div * frac); in ar934x_get_pll_freq() 238 u32 pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv; in ar934x_clocks_init() local 263 frac = 1 << 18; in ar934x_clocks_init() 274 frac = 1 << 6; in ar934x_clocks_init() 278 nfrac, frac, out_div); in ar934x_clocks_init() 290 frac = 1 << 18; in ar934x_clocks_init() 301 frac = 1 << 10; in ar934x_clocks_init() 305 nfrac, frac, out_div); in ar934x_clocks_init() 356 u32 pll, out_div, ref_div, nint, frac, clk_ctrl, postdiv; in qca953x_clocks_init() local [all …]
|
/linux/Documentation/userspace-api/media/v4l/ |
H A D | colorspaces-details.rst | 60 L = -\left( \frac{L' - 0.099}{-1.099} \right) ^{\frac{1}{0.45}} \text{, for } L' \le -0.081 62 L = \frac{L'}{4.5} \text{, for } -0.081 < L' < 0.081 64 L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081 136 L = -\left( \frac{L' - 0.099}{-1.099} \right)^\frac{1}{0.45} \text{, for } L' \le -0.081 138 L = \frac{L'}{4.5}\text{, for } -0.081 < L' < 0.081 140 L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081 173 Y' = \frac{219}{256} * (0.2126R' + 0.7152G' + 0.0722B') + \frac{16}{256} 175 Cb = \frac{224}{256} * (-0.1146R' - 0.3854G' + 0.5B') 177 Cr = \frac{224}{256} * (0.5R' - 0.4542G' - 0.0458B') 186 Y' = \frac{219}{256} * (0.2990R' + 0.5870G' + 0.1140B') + \frac{16}{256} [all …]
|
/linux/kernel/locking/ |
H A D | qspinlock_stat.h | 70 u64 frac = 0; in lockevent_read() local 73 frac = 100ULL * do_div(sum, kicks); in lockevent_read() 74 frac = DIV_ROUND_CLOSEST_ULL(frac, kicks); in lockevent_read() 81 sum, frac); in lockevent_read()
|
/linux/include/linux/ |
H A D | timecounter.h | 60 u64 frac; member 73 u64 cycles, u64 mask, u64 *frac) in cyclecounter_cyc2ns() argument 77 ns = (ns * cc->mult) + *frac; in cyclecounter_cyc2ns() 78 *frac = ns & mask; in cyclecounter_cyc2ns()
|
/linux/drivers/clk/starfive/ |
H A D | clk-starfive-jh7110-pll.c | 82 u32 frac; /* frac value should be decimals multiplied by 2^24 */ member 96 unsigned int frac; member 119 .frac = JH7110_PLL##_idx##_FRAC_OFFSET, \ 150 u32 frac; member 291 regmap_read(regmap, info->offsets.frac, &val); in jh7110_pll_regvals_get() 292 ret->frac = (val & JH7110_PLL_FRAC_MASK) >> JH7110_PLL_FRAC_SHIFT; in jh7110_pll_regvals_get() 316 rate = parent_rate * val.frac / (1UL << 24); in jh7110_pll_recalc_rate() 376 regmap_update_bits(priv->regmap, info->offsets.frac, JH7110_PLL_FRAC_MASK, in jh7110_pll_set_rate() 377 val->frac << JH7110_PLL_FRAC_SHIFT); in jh7110_pll_set_rate() 387 regmap_update_bits(priv->regmap, info->offsets.frac, JH7110_PLL_POSTDIV1_MASK, in jh7110_pll_set_rate() [all …]
|
/linux/arch/powerpc/kernel/ |
H A D | vecemu.c | 42 unsigned int mant, frac; in eexp2() local 76 asm("mulhwu %0,%1,%2" : "=r" (frac) in eexp2() 78 asm("mulhwu %0,%1,%2" : "=r" (frac) : "r" (frac), "r" (mant)); in eexp2() 79 mant += frac; in eexp2() 96 int exp, mant, lz, frac; in elog2() local 136 asm("mulhwu %0,%1,%2" : "=r" (frac) in elog2() 138 exp += frac; in elog2()
|
/linux/drivers/clk/qcom/ |
H A D | clk-rcg2.c | 713 const struct frac_entry *frac; in clk_edp_pixel_set_rate() local 721 frac = frac_table_810m; in clk_edp_pixel_set_rate() 723 frac = frac_table_675m; in clk_edp_pixel_set_rate() 725 for (; frac->num; frac++) { in clk_edp_pixel_set_rate() 727 request *= frac->den; in clk_edp_pixel_set_rate() 728 request = div_s64(request, frac->num); in clk_edp_pixel_set_rate() 738 f.m = frac->num; in clk_edp_pixel_set_rate() 739 f.n = frac->den; in clk_edp_pixel_set_rate() 759 const struct frac_entry *frac; in clk_edp_pixel_determine_rate() local 771 frac = frac_table_810m; in clk_edp_pixel_determine_rate() [all …]
|
/linux/drivers/clk/sunxi-ng/ |
H A D | ccu_mult.c | 81 if (ccu_frac_helper_is_enabled(&cm->common, &cm->frac)) in ccu_mult_recalc_rate() 82 return ccu_frac_helper_read_rate(&cm->common, &cm->frac); in ccu_mult_recalc_rate() 111 if (ccu_frac_helper_has_rate(&cm->common, &cm->frac, rate)) { in ccu_mult_set_rate() 112 ccu_frac_helper_enable(&cm->common, &cm->frac); in ccu_mult_set_rate() 114 return ccu_frac_helper_set_rate(&cm->common, &cm->frac, in ccu_mult_set_rate() 117 ccu_frac_helper_disable(&cm->common, &cm->frac); in ccu_mult_set_rate()
|
H A D | ccu_nm.c | 85 if (ccu_frac_helper_is_enabled(&nm->common, &nm->frac)) { in ccu_nm_recalc_rate() 86 rate = ccu_frac_helper_read_rate(&nm->common, &nm->frac); in ccu_nm_recalc_rate() 142 if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) { in ccu_nm_round_rate() 179 if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) { in ccu_nm_set_rate() 189 ccu_frac_helper_enable(&nm->common, &nm->frac); in ccu_nm_set_rate() 191 return ccu_frac_helper_set_rate(&nm->common, &nm->frac, in ccu_nm_set_rate() 194 ccu_frac_helper_disable(&nm->common, &nm->frac); in ccu_nm_set_rate()
|
/linux/drivers/hwmon/ |
H A D | stts751.c | 150 s32 integer1, integer2, frac; in stts751_update_temp() local 170 frac = i2c_smbus_read_byte_data(priv->client, STTS751_REG_TEMP_L); in stts751_update_temp() 171 if (frac < 0) { in stts751_update_temp() 173 "I2C read failed (temp L). ret: %x\n", frac); in stts751_update_temp() 174 return frac; in stts751_update_temp() 185 frac = i2c_smbus_read_byte_data(priv->client, in stts751_update_temp() 187 if (frac < 0) { in stts751_update_temp() 190 frac); in stts751_update_temp() 191 return frac; in stts751_update_temp() 195 priv->temp = stts751_to_deg((integer1 << 8) | frac); in stts751_update_temp() [all …]
|
/linux/drivers/clk/x86/ |
H A D | clk-cgu-pll.c | 26 unsigned int div, unsigned int frac, unsigned int frac_div) in lgm_pll_calc_rate() argument 32 frate = rate64 * frac; in lgm_pll_calc_rate() 43 unsigned int div, mult, frac; in lgm_pll_recalc_rate() local 47 frac = lgm_get_clk_val(pll->membase, pll->reg, 2, 24); in lgm_pll_recalc_rate() 52 return lgm_pll_calc_rate(prate, mult, div, frac, BIT(24)); in lgm_pll_recalc_rate()
|
/linux/drivers/clk/zynqmp/ |
H A D | pll.c | 140 unsigned long rate, frac; in zynqmp_pll_recalc_rate() local 160 frac = (parent_rate * data) / FRAC_DIV; in zynqmp_pll_recalc_rate() 161 rate = rate + frac; in zynqmp_pll_recalc_rate() 184 long rate_div, frac, m, f; in zynqmp_pll_set_rate() local 195 frac = (parent_rate * f) / FRAC_DIV; in zynqmp_pll_set_rate() 206 return rate + frac; in zynqmp_pll_set_rate()
|