Home
last modified time | relevance | path

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

1234

/linux/drivers/crypto/intel/qat/qat_common/
H A Dadf_clock.c25 return (u64)DIV_ROUND_CLOSEST_ULL(timespec64_to_ns(ts), NSEC_PER_USEC); in timespec_to_us()
30 return (u64)DIV_ROUND_CLOSEST_ULL(timespec64_to_ns(ts), NSEC_PER_MSEC); in timespec_to_ms()
90 temp = DIV_ROUND_CLOSEST_ULL(temp, delta_us); in measure_clock()
/linux/drivers/hwmon/
H A 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()
H A Dtmp513.c557 max_curr_ma = DIV_ROUND_CLOSEST_ULL(vshunt_max * MICRO, data->shunt_uohms); in tmp51x_calibrate()
563 data->curr_lsb_ua = DIV_ROUND_CLOSEST_ULL(max_curr_ma * MILLI, 32767); in tmp51x_calibrate()
566 div = DIV_ROUND_CLOSEST_ULL(data->curr_lsb_ua * data->shunt_uohms, MICRO); in tmp51x_calibrate()
H A Daxi-fan-control.c85 temp = DIV_ROUND_CLOSEST_ULL(temp * 509314ULL, 65535) - 280230; in axi_fan_control_show()
102 temp = DIV_ROUND_CLOSEST_ULL((temp + 280230) * 65535ULL, 509314); in axi_fan_control_store()
/linux/kernel/locking/
H A 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/drivers/clk/renesas/
H A Drcar-gen3-cpg.c76 mult = DIV_ROUND_CLOSEST_ULL(req->rate, prate); in cpg_pll_clk_determine_rate()
90 mult = DIV_ROUND_CLOSEST_ULL(rate, parent_rate * pll_clk->fixed_mult); in cpg_pll_clk_set_rate()
179 return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, in cpg_z_clk_recalc_rate()
207 mult = DIV_ROUND_CLOSEST_ULL(rate * 32ULL, prate); in cpg_z_clk_determine_rate()
210 req->rate = DIV_ROUND_CLOSEST_ULL((u64)prate * mult, 32); in cpg_z_clk_determine_rate()
H A Drcar-gen4-cpg.c125 ni = DIV_ROUND_CLOSEST_ULL(req->rate, prate); in cpg_pll_8_25_clk_determine_rate()
154 ni = DIV_ROUND_CLOSEST_ULL(rate, prate); in cpg_pll_8_25_clk_set_rate()
284 return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, in cpg_z_clk_recalc_rate()
312 mult = DIV_ROUND_CLOSEST_ULL(rate * 32ULL, prate); in cpg_z_clk_determine_rate()
315 req->rate = DIV_ROUND_CLOSEST_ULL((u64)prate * mult, 32); in cpg_z_clk_determine_rate()
/linux/include/drm/
H A Ddrm_color_mgmt.h46 return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1), in drm_color_lut_extract()
65 return DIV_ROUND_CLOSEST_ULL((u64)user_input * max, in drm_color_lut32_extract()
/linux/drivers/pwm/
H A Dpwm-sprd.c108 state->period = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); in sprd_pwm_get_state()
113 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); in sprd_pwm_get_state()
144 prescale = DIV_ROUND_CLOSEST_ULL(tmp, SPRD_PWM_MOD_MAX) - 1; in sprd_pwm_config()
H A Dpwm-dwc-core.c52 tmp = DIV_ROUND_CLOSEST_ULL(state->duty_cycle, dwc->clk_ns); in __dwc_pwm_configure_timer()
57 tmp = DIV_ROUND_CLOSEST_ULL(state->period - state->duty_cycle, in __dwc_pwm_configure_timer()
H A Dpwm-omap-dmtimer.c82 return DIV_ROUND_CLOSEST_ULL((u64)clk_rate * ns, NSEC_PER_SEC); in pwm_omap_dmtimer_get_clock_cycles()
218 DIV_ROUND_CLOSEST_ULL((u64)NSEC_PER_SEC * duty_cycles, in pwm_omap_dmtimer_config()
220 DIV_ROUND_CLOSEST_ULL((u64)NSEC_PER_SEC * period_cycles, in pwm_omap_dmtimer_config()
H A Dpwm-stm32-lp.c338 state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state()
343 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state()
H A Dpwm-sun4i.c159 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in sun4i_pwm_get_state()
162 state->period = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in sun4i_pwm_get_state()
/linux/drivers/gpu/drm/bridge/synopsys/
H A Ddw-mipi-dsi2.c333 phy_hsclk = DIV_ROUND_CLOSEST_ULL(dsi2->lane_mbps * USEC_PER_SEC, 16); in dw_mipi_dsi2_phy_ratio_cfg()
339 tmp = DIV_ROUND_CLOSEST_ULL(phy_hsclk << 16, ipi_clk); in dw_mipi_dsi2_phy_ratio_cfg()
346 tmp = DIV_ROUND_CLOSEST_ULL(phy_hsclk << 16, sys_clk); in dw_mipi_dsi2_phy_ratio_cfg()
480 phy_hs_clk = DIV_ROUND_CLOSEST_ULL(dsi2->lane_mbps * USEC_PER_SEC, 16); in dw_mipi_dsi2_ipi_set()
483 hsa_time = DIV_ROUND_CLOSEST_ULL(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set()
487 hbp_time = DIV_ROUND_CLOSEST_ULL(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set()
491 hact_time = DIV_ROUND_CLOSEST_ULL(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set()
495 hline_time = DIV_ROUND_CLOSEST_ULL(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set()
/linux/drivers/clk/at91/
H A 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()
584 return DIV_ROUND_CLOSEST_ULL(parent_rate, 3); in clk_sama7g5_master_recalc_rate()
586 return DIV_ROUND_CLOSEST_ULL(parent_rate, (1 << master->div)); in clk_sama7g5_master_recalc_rate()
H A Dclk-sam9x60-pll.c79 DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22)); in sam9x60_frac_pll_recalc_rate()
210 nfrac = DIV_ROUND_CLOSEST_ULL((u64)remainder * (1 << 22), in sam9x60_frac_pll_compute_mul_frac()
213 tmprate += DIV_ROUND_CLOSEST_ULL((u64)nfrac * parent_rate, in sam9x60_frac_pll_compute_mul_frac()
442 return DIV_ROUND_CLOSEST_ULL(parent_rate, (div->div + 1)); in sam9x60_div_pll_recalc_rate()
474 tmp_rate = DIV_ROUND_CLOSEST_ULL(tmp_parent_rate, divid); in sam9x60_div_pll_compute_div()
H A Dclk-audio-pll.c166 fr = DIV_ROUND_CLOSEST_ULL(fr, AUDIO_PLL_DIV_FRAC); in clk_audio_pll_fout()
234 tmp = DIV_ROUND_CLOSEST_ULL(tmp, parent_rate); in clk_audio_pll_frac_compute_frac()
/linux/drivers/clk/xilinx/
H A Dclk-xlnx-clock-wizard.c364 o = DIV_ROUND_CLOSEST_ULL(vco_freq, rate); in clk_wzrd_get_divisors_ver()
367 freq = DIV_ROUND_CLOSEST_ULL(vco_freq, o); in clk_wzrd_get_divisors_ver()
404 vco_freq = DIV_ROUND_CLOSEST_ULL((parent_rate * m), d); in clk_wzrd_get_divisors()
405 o = DIV_ROUND_CLOSEST_ULL(vco_freq, rate); in clk_wzrd_get_divisors()
408 freq = DIV_ROUND_CLOSEST_ULL(vco_freq, o); in clk_wzrd_get_divisors()
582 return DIV_ROUND_CLOSEST_ULL(parent_rate * mul, d * (o * 1000 + f)); in clk_wzrd_recalc_rate_all()
693 f = DIV_ROUND_CLOSEST_ULL(req->rate * WZRD_FRAC_POINTS, in clk_wzrd_ver_determine_rate_all()
/linux/drivers/clk/bcm/
H A Dclk-kona.c697 scaled_parent_rate = DIV_ROUND_CLOSEST_ULL(scaled_rate, in clk_recalc_rate()
709 result = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, scaled_div); in clk_recalc_rate()
756 scaled_parent_rate = DIV_ROUND_CLOSEST_ULL(scaled_rate, in round_rate()
768 best_scaled_div = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, in round_rate()
781 result = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, best_scaled_div); in round_rate()
/linux/drivers/regulator/
H A Dadp5055-regulator.c162 DIV_ROUND_CLOSEST_ULL(192000 - adp5055->dvs_limit_upper[i], 12000)); in adp5055_parse_fw()
164 DIV_ROUND_CLOSEST_ULL(adp5055->dvs_limit_lower[i] + 190500, 12000)); in adp5055_parse_fw()
H A Dpwm-regulator.c185 voltage = DIV_ROUND_CLOSEST_ULL((u64)voltage * diff_uV, diff_duty); in pwm_regulator_get_voltage()
218 dutycycle = DIV_ROUND_CLOSEST_ULL((u64)(req_min_uV - min_uV) * in pwm_regulator_set_voltage()
/linux/drivers/clk/sprd/
H A 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/drivers/net/phy/
H A Dbcm54140.c84 #define BCM54140_HWMON_FROM_TEMP(v) DIV_ROUND_CLOSEST_ULL(413350L - (v), 491)
93 #define BCM54140_HWMON_FROM_IN_1V0(v) DIV_ROUND_CLOSEST_ULL(((v) << 11), 2514)
102 #define BCM54140_HWMON_FROM_IN_3V3(v) DIV_ROUND_CLOSEST_ULL(((v) << 12), 4400)
/linux/drivers/gpu/drm/i915/
H A Di915_hwmon.c233 val = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_time, SF_TIME); in hwm_power1_max_interval_store()
486 nval = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_power, SF_POWER); in hwm_power_max_write()
537 uval = DIV_ROUND_CLOSEST_ULL(val << POWER_SETUP_I1_SHIFT, SF_POWER); in hwm_power_write()
652 uval = DIV_ROUND_CLOSEST_ULL(val << POWER_SETUP_I1_SHIFT, SF_CURR); in hwm_curr_write()
/linux/drivers/gpu/drm/renesas/rz-du/
H A Drzg2l_mipi_dsi.c479 unsigned long hsfreq = DIV_ROUND_CLOSEST_ULL(hsfreq_millihz, MILLI); in rzg2l_mipi_dsi_dphy_init()
570 *hsfreq_millihz = DIV_ROUND_CLOSEST_ULL(mul_u32_u32(vclk_rate, bpp * MILLI), in rzg2l_dphy_conf_clks()
597 hsfreq_millihz = DIV_ROUND_CLOSEST_ULL(cpg_dsi_parameters.div.freq_millihz * bpp, in rzv2h_dphy_mode_clk_check()
643 hsfreq = DIV_ROUND_CLOSEST_ULL(hsfreq_millihz, MILLI); in rzv2h_mipi_dsi_dphy_init()
773 hsfreq = DIV_ROUND_CLOSEST_ULL(hsfreq_millihz, MILLI); in rzg2l_mipi_dsi_startup()

1234