Home
last modified time | relevance | path

Searched refs:DIV_ROUND_CLOSEST_ULL (Results 1 – 25 of 98) sorted by relevance

1234

/linux-6.6.21/drivers/crypto/intel/qat/qat_common/
Dadf_clock.c24 return (u64)DIV_ROUND_CLOSEST_ULL(timespec64_to_ns(ts), NSEC_PER_USEC); in timespec_to_us()
29 return (u64)DIV_ROUND_CLOSEST_ULL(timespec64_to_ns(ts), NSEC_PER_MSEC); in timespec_to_ms()
86 temp = DIV_ROUND_CLOSEST_ULL(temp, delta_us); in measure_clock()
/linux-6.6.21/drivers/hwmon/
Dltc2945.c129 val = DIV_ROUND_CLOSEST_ULL(val, shunt_resistor); in ltc2945_reg_to_val()
160 val = DIV_ROUND_CLOSEST_ULL(val, shunt_resistor); in ltc2945_reg_to_val()
199 val = DIV_ROUND_CLOSEST_ULL(val, 625 * 1000); in ltc2945_val_to_reg()
205 val = DIV_ROUND_CLOSEST_ULL(val, 25 * 1000) * 2; in ltc2945_val_to_reg()
215 val = DIV_ROUND_CLOSEST_ULL(val, 25); in ltc2945_val_to_reg()
233 val = DIV_ROUND_CLOSEST_ULL(val, 25 * 1000); in ltc2945_val_to_reg()
Dtmp513.c545 max_curr_ma = DIV_ROUND_CLOSEST_ULL(vshunt_max * 1000 * 1000, in tmp51x_calibrate()
552 data->curr_lsb_ua = DIV_ROUND_CLOSEST_ULL(max_curr_ma * 1000, 32767); in tmp51x_calibrate()
555 div = DIV_ROUND_CLOSEST_ULL(data->curr_lsb_ua * data->shunt_uohms, in tmp51x_calibrate()
/linux-6.6.21/drivers/clk/renesas/
Drcar-gen4-cpg.c93 mult = DIV_ROUND_CLOSEST_ULL(req->rate, prate); in cpg_pll_clk_determine_rate()
107 mult = DIV_ROUND_CLOSEST_ULL(rate, parent_rate * 2); in cpg_pll_clk_set_rate()
205 return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, in cpg_z_clk_recalc_rate()
233 mult = DIV_ROUND_CLOSEST_ULL(rate * 32ULL, prate); in cpg_z_clk_determine_rate()
236 req->rate = DIV_ROUND_CLOSEST_ULL((u64)prate * mult, 32); in cpg_z_clk_determine_rate()
Drcar-gen3-cpg.c78 mult = DIV_ROUND_CLOSEST_ULL(req->rate, prate); in cpg_pll_clk_determine_rate()
92 mult = DIV_ROUND_CLOSEST_ULL(rate, parent_rate * pll_clk->fixed_mult); in cpg_pll_clk_set_rate()
185 return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, in cpg_z_clk_recalc_rate()
213 mult = DIV_ROUND_CLOSEST_ULL(rate * 32ULL, prate); in cpg_z_clk_determine_rate()
216 req->rate = DIV_ROUND_CLOSEST_ULL((u64)prate * mult, 32); in cpg_z_clk_determine_rate()
/linux-6.6.21/kernel/locking/
Dqspinlock_stat.h74 frac = DIV_ROUND_CLOSEST_ULL(frac, kicks); in lockevent_read()
89 sum = DIV_ROUND_CLOSEST_ULL(sum, kicks); in lockevent_read()
/linux-6.6.21/drivers/pwm/
Dpwm-rockchip.c83 state->period = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in rockchip_pwm_get_state()
87 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in rockchip_pwm_get_state()
119 period = DIV_ROUND_CLOSEST_ULL(div, in rockchip_pwm_config()
123 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
Dpwm-sprd.c107 state->period = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); in sprd_pwm_get_state()
112 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); in sprd_pwm_get_state()
143 prescale = DIV_ROUND_CLOSEST_ULL(tmp, SPRD_PWM_MOD_MAX) - 1; in sprd_pwm_config()
Dpwm-bcm2835.c97 period_cycles = DIV_ROUND_CLOSEST_ULL(state->period * rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
106 val = DIV_ROUND_CLOSEST_ULL(state->duty_cycle * rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
Dpwm-omap-dmtimer.c87 return DIV_ROUND_CLOSEST_ULL((u64)clk_rate * ns, NSEC_PER_SEC); in pwm_omap_dmtimer_get_clock_cycles()
223 DIV_ROUND_CLOSEST_ULL((u64)NSEC_PER_SEC * duty_cycles, in pwm_omap_dmtimer_config()
225 DIV_ROUND_CLOSEST_ULL((u64)NSEC_PER_SEC * period_cycles, in pwm_omap_dmtimer_config()
Dpwm-mediatek.c143 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution); in pwm_mediatek_config()
147 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, in pwm_mediatek_config()
166 cnt_duty = DIV_ROUND_CLOSEST_ULL((u64)duty_ns * 1000, resolution); in pwm_mediatek_config()
Dpwm-imx-tpm.c98 clock_unit = DIV_ROUND_CLOSEST_ULL(tmp, NSEC_PER_SEC); in pwm_imx_tpm_round_state()
114 real_state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_round_state()
152 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_get_state()
Dpwm-stm32-lp.c181 state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state()
186 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state()
Dpwm-dwc.c98 tmp = DIV_ROUND_CLOSEST_ULL(state->duty_cycle, DWC_CLK_PERIOD_NS); in __dwc_pwm_configure_timer()
103 tmp = DIV_ROUND_CLOSEST_ULL(state->period - state->duty_cycle, in __dwc_pwm_configure_timer()
/linux-6.6.21/drivers/clk/x86/
Dclk-cgu.c468 div = DIV_ROUND_CLOSEST_ULL((u64)prate, rate); in lgm_clk_ddiv_set_rate()
471 div = DIV_ROUND_CLOSEST_ULL((u64)div, 5); in lgm_clk_ddiv_set_rate()
498 div = DIV_ROUND_CLOSEST_ULL((u64)*prate, rate); in lgm_clk_ddiv_round_rate()
503 div = DIV_ROUND_CLOSEST_ULL((u64)div, 5); in lgm_clk_ddiv_round_rate()
520 rate64 = DIV_ROUND_CLOSEST_ULL(rate64, 5); in lgm_clk_ddiv_round_rate()
/linux-6.6.21/drivers/clk/at91/
Dclk-master.c222 return DIV_ROUND_CLOSEST_ULL(parent_rate, master->div); in clk_master_div_recalc_rate_chg()
310 new_rate = DIV_ROUND_CLOSEST_ULL(new_parent_rate, in clk_master_div_notifier_fn()
397 return DIV_ROUND_CLOSEST_ULL(parent_rate, pres); in clk_master_pres_recalc_rate()
435 master->pms.rate = DIV_ROUND_CLOSEST_ULL(master->pms.parent_rate, pres); in clk_master_pres_save_context()
458 DIV_ROUND_CLOSEST_ULL(master->pms.parent_rate, pres) || in clk_master_pres_restore_context()
583 return DIV_ROUND_CLOSEST_ULL(parent_rate, (1 << master->div)); in clk_sama7g5_master_recalc_rate()
Dclk-sam9x60-pll.c81 DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22)); in sam9x60_frac_pll_recalc_rate()
209 nfrac = DIV_ROUND_CLOSEST_ULL((u64)remainder * (1 << 22), in sam9x60_frac_pll_compute_mul_frac()
212 tmprate += DIV_ROUND_CLOSEST_ULL((u64)nfrac * parent_rate, in sam9x60_frac_pll_compute_mul_frac()
433 return DIV_ROUND_CLOSEST_ULL(parent_rate, (div->div + 1)); in sam9x60_div_pll_recalc_rate()
459 tmp_rate = DIV_ROUND_CLOSEST_ULL(tmp_parent_rate, divid); in sam9x60_div_pll_compute_div()
/linux-6.6.21/drivers/i2c/busses/
Di2c-designware-common.c354 return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * tSYMBOL, MICRO) - in i2c_dw_scl_hcnt()
371 return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tSYMBOL + tf), MICRO) - in i2c_dw_scl_hcnt()
388 return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tLOW + tf), MICRO) - in i2c_dw_scl_lcnt()
/linux-6.6.21/drivers/clk/bcm/
Dclk-kona.c70 return DIV_ROUND_CLOSEST_ULL(combined, BILLION); in scaled_div_build()
714 scaled_parent_rate = DIV_ROUND_CLOSEST_ULL(scaled_rate, in clk_recalc_rate()
726 result = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, scaled_div); in clk_recalc_rate()
773 scaled_parent_rate = DIV_ROUND_CLOSEST_ULL(scaled_rate, in round_rate()
785 best_scaled_div = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, in round_rate()
798 result = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, best_scaled_div); in round_rate()
/linux-6.6.21/include/linux/
Dpwm.h215 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle()
244 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle()
/linux-6.6.21/drivers/clk/xilinx/
Dclk-xlnx-clock-wizard.c238 freq = DIV_ROUND_CLOSEST_ULL(vco_freq, o); in clk_wzrd_get_divisors()
267 rate_div = DIV_ROUND_CLOSEST_ULL((vco_freq * WZRD_FRAC_POINTS), rate); in clk_wzrd_dynamic_all_nolock()
271 pre = DIV_ROUND_CLOSEST_ULL(vco_freq * WZRD_FRAC_POINTS, rate); in clk_wzrd_dynamic_all_nolock()
357 f = DIV_ROUND_CLOSEST_ULL(rate * WZRD_FRAC_POINTS, int_freq); in clk_wzrd_round_rate_all()
/linux-6.6.21/drivers/gpu/drm/i915/
Di915_hwmon.c221 val = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_time, SF_TIME); in hwm_power1_max_interval_store()
441 nval = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_power, SF_POWER); in hwm_power_max_write()
493 uval = DIV_ROUND_CLOSEST_ULL(val << POWER_SETUP_I1_SHIFT, SF_POWER); in hwm_power_write()
608 uval = DIV_ROUND_CLOSEST_ULL(val << POWER_SETUP_I1_SHIFT, SF_CURR); in hwm_curr_write()
/linux-6.6.21/drivers/regulator/
Dpwm-regulator.c178 voltage = DIV_ROUND_CLOSEST_ULL((u64)voltage * diff_uV, diff_duty); in pwm_regulator_get_voltage()
211 dutycycle = DIV_ROUND_CLOSEST_ULL((u64)(req_min_uV - min_uV) * in pwm_regulator_set_voltage()
/linux-6.6.21/drivers/clk/sprd/
Dpll.c135 rate = DIV_ROUND_CLOSEST_ULL(refin * kint * k1, in _sprd_pll_recalc_rate()
204 kint = DIV_ROUND_CLOSEST_ULL(tmp, refin * 100); in _sprd_pll_set_rate()
/linux-6.6.21/drivers/net/phy/
Dbcm54140.c83 #define BCM54140_HWMON_FROM_TEMP(v) DIV_ROUND_CLOSEST_ULL(413350L - (v), 491)
92 #define BCM54140_HWMON_FROM_IN_1V0(v) DIV_ROUND_CLOSEST_ULL(((v) << 11), 2514)
101 #define BCM54140_HWMON_FROM_IN_3V3(v) DIV_ROUND_CLOSEST_ULL(((v) << 12), 4400)

1234