| /linux/drivers/crypto/intel/qat/qat_common/ |
| 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/ |
| 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()
|
| A D | tmp513.c | 554 max_curr_ma = DIV_ROUND_CLOSEST_ULL(vshunt_max * MICRO, data->shunt_uohms); in tmp51x_calibrate() 560 data->curr_lsb_ua = DIV_ROUND_CLOSEST_ULL(max_curr_ma * MILLI, 32767); in tmp51x_calibrate() 563 div = DIV_ROUND_CLOSEST_ULL(data->curr_lsb_ua * data->shunt_uohms, MICRO); in tmp51x_calibrate()
|
| /linux/kernel/locking/ |
| 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/drivers/clk/renesas/ |
| A D | rcar-gen3-cpg.c | 78 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()
|
| 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() 288 return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, in cpg_z_clk_recalc_rate() 316 mult = DIV_ROUND_CLOSEST_ULL(rate * 32ULL, prate); in cpg_z_clk_determine_rate() 319 req->rate = DIV_ROUND_CLOSEST_ULL((u64)prate * mult, 32); in cpg_z_clk_determine_rate()
|
| /linux/drivers/pwm/ |
| A D | pwm-rockchip.c | 82 state->period = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in rockchip_pwm_get_state() 86 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in rockchip_pwm_get_state() 118 period = DIV_ROUND_CLOSEST_ULL(div, in rockchip_pwm_config() 122 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
|
| 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()
|
| 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()
|
| A D | pwm-mediatek.c | 140 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution); in pwm_mediatek_config() 144 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, in pwm_mediatek_config() 163 cnt_duty = DIV_ROUND_CLOSEST_ULL((u64)duty_ns * 1000, resolution); in pwm_mediatek_config()
|
| 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()
|
| A D | pwm-bcm2835.c | 90 period_cycles = DIV_ROUND_CLOSEST_ULL(state->period * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply() 99 val = DIV_ROUND_CLOSEST_ULL(state->duty_cycle * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
|
| 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()
|
| A D | pwm-stm32-lp.c | 180 state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state() 185 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state()
|
| /linux/drivers/clk/x86/ |
| A D | clk-cgu.c | 468 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/drivers/iio/dac/ |
| A D | adi-axi-dac.c | 167 *freq = DIV_ROUND_CLOSEST_ULL(raw * st->dac_clk, BIT(16)); in __axi_dac_frequency_get() 207 scale = DIV_ROUND_CLOSEST_ULL((u64)raw * MEGA, AXI_DAC_SCALE_INT); in axi_dac_scale_get() 239 phase = DIV_ROUND_CLOSEST_ULL((u64)raw * AXI_DAC_2_PI_MEGA, U16_MAX); in axi_dac_phase_get() 355 raw = DIV_ROUND_CLOSEST_ULL((u64)phase * U16_MAX, AXI_DAC_2_PI_MEGA); in axi_dac_phase_set()
|
| /linux/drivers/clk/at91/ |
| 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() 583 return DIV_ROUND_CLOSEST_ULL(parent_rate, (1 << master->div)); in clk_sama7g5_master_recalc_rate()
|
| A D | clk-sam9x60-pll.c | 79 DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22)); in sam9x60_frac_pll_recalc_rate() 213 nfrac = DIV_ROUND_CLOSEST_ULL((u64)remainder * (1 << 22), in sam9x60_frac_pll_compute_mul_frac() 216 tmprate += DIV_ROUND_CLOSEST_ULL((u64)nfrac * parent_rate, in sam9x60_frac_pll_compute_mul_frac() 438 return DIV_ROUND_CLOSEST_ULL(parent_rate, (div->div + 1)); in sam9x60_div_pll_recalc_rate() 470 tmp_rate = DIV_ROUND_CLOSEST_ULL(tmp_parent_rate, divid); in sam9x60_div_pll_compute_div()
|
| /linux/include/drm/ |
| 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()
|
| /linux/drivers/i2c/busses/ |
| A D | i2c-designware-common.c | 432 return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * tSYMBOL, MICRO) - in i2c_dw_scl_hcnt() 449 return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tSYMBOL + tf), MICRO) - in i2c_dw_scl_hcnt() 470 return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tLOW + tf), MICRO) - in i2c_dw_scl_lcnt() 549 fsleep(DIV_ROUND_CLOSEST_ULL(10 * MICRO, t->bus_freq_hz)); in __i2c_dw_disable()
|
| /linux/drivers/clk/bcm/ |
| A D | clk-kona.c | 70 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/include/linux/ |
| A D | pwm.h | 203 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle() 232 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle()
|
| /linux/drivers/clk/sprd/ |
| 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()
|
| /linux/drivers/gpu/drm/i915/ |
| A D | i915_hwmon.c | 231 val = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_time, SF_TIME); in hwm_power1_max_interval_store() 452 nval = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_power, SF_POWER); in hwm_power_max_write() 503 uval = DIV_ROUND_CLOSEST_ULL(val << POWER_SETUP_I1_SHIFT, SF_POWER); in hwm_power_write() 618 uval = DIV_ROUND_CLOSEST_ULL(val << POWER_SETUP_I1_SHIFT, SF_CURR); in hwm_curr_write()
|
| /linux/drivers/net/phy/ |
| A D | bcm54140.c | 83 #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)
|