| /linux/drivers/crypto/intel/qat/qat_common/ |
| H A D | adf_clock.c | 25 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 D | ltc2945.c | 129 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 D | htu31.c | 62 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 D | tmp513.c | 557 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 D | rcar-gen3-cpg.c | 76 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 D | rcar-gen4-cpg.c | 125 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 D | qspinlock_stat.h | 74 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 D | drm_color_mgmt.h | 46 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 D | pwm-sprd.c | 108 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 D | pwm-dwc-core.c | 52 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 D | pwm-bcm2835.c | 67 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 D | pwm-omap-dmtimer.c | 82 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 D | pwm-imx-tpm.c | 98 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 D | dw-mipi-dsi2-rockchip.c | 163 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 D | dw-mipi-dsi2.c | 333 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 D | clk-master.c | 222 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 D | clk-sam9x60-pll.c | 79 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 D | drm_hdmi_helper.c | 257 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 D | clk-xlnx-clock-wizard.c | 364 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 D | clk-kona.c | 697 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 D | phy-rockchip-samsung-dcphy.c | 1166 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 D | adi-axi-dac.c | 208 *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 D | adp5055-regulator.c | 162 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 D | pwm.h | 232 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 D | pll.c | 135 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()
|