Home
last modified time | relevance | path

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

12345

/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 Dhtu31.c62 return -40000 + DIV_ROUND_CLOSEST_ULL(165000ULL * val, 65535); in htu31_temp_to_millicelsius()
67 return DIV_ROUND_CLOSEST_ULL(100000ULL * val, 65535); in htu31_relative_humidity()
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()
/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/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/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-bcm2835.c67 period_cycles = DIV_ROUND_CLOSEST_ULL(state->period * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
76 val = DIV_ROUND_CLOSEST_ULL(state->duty_cycle * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
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-imx-tpm.c98 clock_unit = DIV_ROUND_CLOSEST_ULL(tmp, NSEC_PER_SEC); in pwm_imx_tpm_round_state()
116 real_state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_round_state()
154 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_get_state()
/linux/drivers/gpu/drm/rockchip/
H A Ddw-mipi-dsi2-rockchip.c163 target_phyclk = DIV_ROUND_CLOSEST_ULL(lane_rate_kbps * lanes * 1000, bpp); in dw_mipi_dsi2_get_lane_mbps()
187 hstx_clk = DIV_ROUND_CLOSEST_ULL(dsi2->lane_mbps * USEC_PER_SEC, 16); in dw_mipi_dsi2_phy_get_timing()
194 tmp = DIV_ROUND_CLOSEST_ULL(tmp << 16, ui); in dw_mipi_dsi2_phy_get_timing()
199 tmp = DIV_ROUND_CLOSEST_ULL(tmp << 16, ui); in dw_mipi_dsi2_phy_get_timing()
/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()
/linux/drivers/gpu/drm/display/
H A Ddrm_hdmi_helper.c257 return DIV_ROUND_CLOSEST_ULL(clock * bpc, 8); in drm_hdmi_compute_mode_clock()
387 unsigned long tmds_clock_khz = DIV_ROUND_CLOSEST_ULL(tmds_char_rate, 1000); in drm_hdmi_acr_get_n_cts()
421 cts = DIV_ROUND_CLOSEST_ULL(tmds_char_rate * n, in drm_hdmi_acr_get_n_cts()
/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/phy/rockchip/
H A Dphy-rockchip-samsung-dcphy.c1166 max_prediv = DIV_ROUND_CLOSEST_ULL(fin, 6 * MSEC_PER_SEC); in samsung_mipi_dcphy_pll_round_rate()
1171 _fbdiv = DIV_ROUND_CLOSEST_ULL(fvco * _prediv, 2 * fin); in samsung_mipi_dcphy_pll_round_rate()
1183 tmp = DIV_ROUND_CLOSEST_ULL((_fbdiv * fin * 2 * 1000), _prediv); in samsung_mipi_dcphy_pll_round_rate()
1184 tmp += DIV_ROUND_CLOSEST_ULL((_dsm * fin * 1000), _prediv << 15); in samsung_mipi_dcphy_pll_round_rate()
1193 best_freq = DIV_ROUND_CLOSEST_ULL(tmp, 1000) * MSEC_PER_SEC; in samsung_mipi_dcphy_pll_round_rate()
/linux/drivers/iio/dac/
H A Dadi-axi-dac.c208 *freq = DIV_ROUND_CLOSEST_ULL(raw * st->dac_clk, BIT(16)); in __axi_dac_frequency_get()
251 scale = DIV_ROUND_CLOSEST_ULL((u64)raw * MEGA, in axi_dac_scale_get()
287 phase = DIV_ROUND_CLOSEST_ULL((u64)raw * AXI_DAC_2_PI_MEGA, U16_MAX); in axi_dac_phase_get()
415 raw = DIV_ROUND_CLOSEST_ULL((u64)phase * U16_MAX, AXI_DAC_2_PI_MEGA); in axi_dac_phase_set()
/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()
/linux/include/linux/
H A Dpwm.h232 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle()
261 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle()
/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()

12345