| /Linux-v5.4/drivers/clk/ |
| D | clk-clps711x.c | 72 f_spi = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 96); in clps711x_clk_init_dt() 74 f_pwm = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 128); in clps711x_clk_init_dt() 81 f_spi = DIV_ROUND_CLOSEST(f_cpu, 576); in clps711x_clk_init_dt() 82 f_pwm = DIV_ROUND_CLOSEST(f_cpu, 768); in clps711x_clk_init_dt() 87 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 26); in clps711x_clk_init_dt() 89 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 24); in clps711x_clk_init_dt() 91 f_tim = DIV_ROUND_CLOSEST(f_cpu, 144); in clps711x_clk_init_dt()
|
| /Linux-v5.4/drivers/gpu/drm/nouveau/nvkm/subdev/volt/ |
| D | gk20a.c | 56 mv = DIV_ROUND_CLOSEST(coef->c2 * speedo, s_scale); in gk20a_volt_get_cvb_voltage() 57 mv = DIV_ROUND_CLOSEST((mv + coef->c1) * speedo, s_scale) + coef->c0; in gk20a_volt_get_cvb_voltage() 74 mv = DIV_ROUND_CLOSEST(coef->c3 * speedo, s_scale) + coef->c4 + in gk20a_volt_get_cvb_t_voltage() 75 DIV_ROUND_CLOSEST(coef->c5 * temp, t_scale); in gk20a_volt_get_cvb_t_voltage() 76 mv = DIV_ROUND_CLOSEST(mv * temp, t_scale) + cvb_mv; in gk20a_volt_get_cvb_t_voltage()
|
| /Linux-v5.4/drivers/media/pci/cx23885/ |
| D | cx23888-ir.c | 181 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_clock_divider() 187 return DIV_ROUND_CLOSEST((divider + 1) * 1000, in clock_divider_to_ns() 194 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, freq * 16)); in carrier_freq_to_clock_divider() 199 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, (divider + 1) * 16); in clock_divider_to_carrier_freq() 206 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, freq * rollovers)); in freq_to_clock_divider() 212 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, in clock_divider_to_freq() 235 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_lpf_count() 241 return DIV_ROUND_CLOSEST(count * 1000, in lpf_count_to_ns() 248 return DIV_ROUND_CLOSEST(count, CX23888_IR_REFCLK_FREQ / 1000000); in lpf_count_to_us() 261 return DIV_ROUND_CLOSEST((1 << 2) * ((u32) divider + 1) * 1000, in clock_divider_to_resolution() [all …]
|
| /Linux-v5.4/drivers/hwmon/pmbus/ |
| D | lm25066.c | 229 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25066_read_word_data() 233 ret = DIV_ROUND_CLOSEST(ret * 2832, 45400); in lm25066_read_word_data() 237 ret = DIV_ROUND_CLOSEST(ret * 70, 453); in lm25066_read_word_data() 242 ret = DIV_ROUND_CLOSEST(ret * 725, 2180); in lm25066_read_word_data() 302 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25056_read_word_data() 310 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25056_read_word_data() 381 word = DIV_ROUND_CLOSEST((int)word * 6140, 293); in lm25066_write_word_data() 389 word = DIV_ROUND_CLOSEST((int)word * 6140, 293); in lm25066_write_word_data()
|
| D | zl6100.c | 104 mantissa = DIV_ROUND_CLOSEST(val, 1000); in zl6100_d2l() 177 ret = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(ret) * 9, 10)); in zl6100_read_word_data() 180 ret = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(ret) * 11, 10)); in zl6100_read_word_data() 237 word = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(word) * 10, 9)); in zl6100_write_word_data() 246 word = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(word) * 10, 11)); in zl6100_write_word_data()
|
| /Linux-v5.4/drivers/media/i2c/cx25840/ |
| D | cx25840-ir.c | 142 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_clock_divider() 148 return DIV_ROUND_CLOSEST((divider + 1) * 1000, in clock_divider_to_ns() 155 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, freq * 16)); in carrier_freq_to_clock_divider() 160 return DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, (divider + 1) * 16); in clock_divider_to_carrier_freq() 167 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, freq * rollovers)); in freq_to_clock_divider() 173 return DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, in clock_divider_to_freq() 196 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_lpf_count() 202 return DIV_ROUND_CLOSEST(count * 1000, in lpf_count_to_ns() 209 return DIV_ROUND_CLOSEST(count, CX25840_IR_REFCLK_FREQ / 1000000); in lpf_count_to_us() 222 return DIV_ROUND_CLOSEST((1 << 2) * ((u32) divider + 1) * 1000, in clock_divider_to_resolution() [all …]
|
| /Linux-v5.4/drivers/hwmon/ |
| D | mc13783-adc.c | 79 val = DIV_ROUND_CLOSEST(val * 9, 2); in mc13783_adc_bp_show() 85 val = DIV_ROUND_CLOSEST(val * 9, 4) + 2400; in mc13783_adc_bp_show() 104 val = DIV_ROUND_CLOSEST(val * 9, 4); in mc13783_adc_gp_show() 123 val = DIV_ROUND_CLOSEST(val * 4800, 1024); in mc13783_adc_uid_show() 126 val = DIV_ROUND_CLOSEST(val * 2555, 1024); in mc13783_adc_uid_show() 149 ret = DIV_ROUND_CLOSEST(-2635920 + val * 4244, 10); in mc13783_adc_temp_show()
|
| D | ina2xx.c | 152 return DIV_ROUND_CLOSEST(avg * INA226_TOTAL_CONV_TIME_DEFAULT, 1000); in ina226_reg_to_interval() 163 avg = DIV_ROUND_CLOSEST(interval * 1000, in ina226_interval_to_reg() 262 val = DIV_ROUND_CLOSEST((s16)regval, data->config->shunt_div); in ina2xx_get_value() 267 val = DIV_ROUND_CLOSEST(val, 1000); in ina2xx_get_value() 275 val = DIV_ROUND_CLOSEST(val, 1000); in ina2xx_get_value() 314 unsigned int dividend = DIV_ROUND_CLOSEST(1000000000, in ina2xx_set_shunt() 321 data->current_lsb_uA = DIV_ROUND_CLOSEST(dividend, val); in ina2xx_set_shunt()
|
| D | ads7828.c | 66 DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000)); in ads7828_in_show() 132 vref_mv = DIV_ROUND_CLOSEST(vref_uv, 1000); in ads7828_probe() 152 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096); in ads7828_probe() 156 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256); in ads7828_probe()
|
| D | ltc4222.c | 64 val = DIV_ROUND_CLOSEST(val * 5, 4); in ltc4222_get_value() 69 val = DIV_ROUND_CLOSEST(val * 125, 4); in ltc4222_get_value() 80 val = DIV_ROUND_CLOSEST(val * 125, 2); in ltc4222_get_value()
|
| D | da9055-hwmon.c | 119 return DIV_ROUND_CLOSEST(value * 1000, DA9055_VSYS_DIV) + 2500; in volt_reg_to_mv() 121 return DIV_ROUND_CLOSEST(value * 1000, DA9055_ADCIN_DIV); in volt_reg_to_mv() 194 return sprintf(buf, "%d\n", DIV_ROUND_CLOSEST(-4084 * (tjunc - toffset) in da9055_tjunc_show()
|
| D | da9052-hwmon.c | 52 return DIV_ROUND_CLOSEST(value * 2000, 1023) + 2500; in volt_reg_to_mv() 58 return DIV_ROUND_CLOSEST(value * 2500, 1023); in input_reg_to_mv() 64 return DIV_ROUND_CLOSEST(value * 5000, 1023); in vbbat_reg_to_mv() 69 return DIV_ROUND_CLOSEST(value * hwmon->tsiref_mv, 1023); in input_tsireg_to_mv() 128 return sprintf(buf, "%d\n", DIV_ROUND_CLOSEST(ret * 39, 10)); in da9052_ich_show()
|
| /Linux-v5.4/drivers/clk/sunxi-ng/ |
| D | ccu_phase.c | 52 step = DIV_ROUND_CLOSEST(360, parent_div); in ccu_phase_get_phase() 104 step = DIV_ROUND_CLOSEST(360, parent_div); in ccu_phase_set_phase() 105 delay = DIV_ROUND_CLOSEST(degrees, step); in ccu_phase_set_phase()
|
| /Linux-v5.4/drivers/gpu/drm/i915/display/ |
| D | intel_dp_aux_backlight.c | 128 fxp = DIV_ROUND_CLOSEST(KHz(DP_EDP_BACKLIGHT_FREQ_BASE_KHZ), freq); in intel_dp_aux_set_pwm_freq() 150 fxp_min = DIV_ROUND_CLOSEST(fxp * 3, 4); in intel_dp_aux_set_pwm_freq() 151 fxp_max = DIV_ROUND_CLOSEST(fxp * 5, 4); in intel_dp_aux_set_pwm_freq() 158 f = clamp(DIV_ROUND_CLOSEST(fxp, 1 << pn), 1, 255); in intel_dp_aux_set_pwm_freq()
|
| /Linux-v5.4/drivers/staging/iio/adc/ |
| D | ad7192.c | 410 fadc = DIV_ROUND_CLOSEST(st->fclk, in ad7192_get_available_filter_freq() 412 freq[0] = DIV_ROUND_CLOSEST(fadc * 240, 1024); in ad7192_get_available_filter_freq() 414 fadc = DIV_ROUND_CLOSEST(st->fclk, in ad7192_get_available_filter_freq() 416 freq[1] = DIV_ROUND_CLOSEST(fadc * 240, 1024); in ad7192_get_available_filter_freq() 418 fadc = DIV_ROUND_CLOSEST(st->fclk, AD7192_MODE_RATE(st->mode)); in ad7192_get_available_filter_freq() 419 freq[2] = DIV_ROUND_CLOSEST(fadc * 230, 1024); in ad7192_get_available_filter_freq() 420 freq[3] = DIV_ROUND_CLOSEST(fadc * 272, 1024); in ad7192_get_available_filter_freq() 539 fadc = DIV_ROUND_CLOSEST(st->fclk, in ad7192_get_3db_filter_freq() 543 return DIV_ROUND_CLOSEST(fadc * 240, 1024); in ad7192_get_3db_filter_freq() 545 return DIV_ROUND_CLOSEST(fadc * 272, 1024); in ad7192_get_3db_filter_freq() [all …]
|
| /Linux-v5.4/drivers/clk/at91/ |
| D | clk-usb.c | 52 return DIV_ROUND_CLOSEST(parent_rate, (usbdiv + 1)); in at91sam9x5_clk_usb_recalc_rate() 78 tmp_rate = DIV_ROUND_CLOSEST(tmp_parent_rate, div); in at91sam9x5_clk_usb_determine_rate() 137 div = DIV_ROUND_CLOSEST(parent_rate, rate); in at91sam9x5_clk_usb_set_rate() 309 tmprate = DIV_ROUND_CLOSEST(tmp_parent_rate, usb->divisors[i]); in at91rm9200_clk_usb_round_rate() 338 div = DIV_ROUND_CLOSEST(parent_rate, rate); in at91rm9200_clk_usb_set_rate()
|
| D | clk-generated.c | 95 return DIV_ROUND_CLOSEST(parent_rate, gck->gckdiv + 1); in clk_generated_recalc_rate() 138 min_rate = DIV_ROUND_CLOSEST(parent_rate, GENERATED_MAX_DIV + 1); in clk_generated_determine_rate() 143 div = DIV_ROUND_CLOSEST(parent_rate, req->rate); in clk_generated_determine_rate() 227 div = DIV_ROUND_CLOSEST(parent_rate, rate); in clk_generated_set_rate()
|
| /Linux-v5.4/drivers/leds/ |
| D | leds-ipaq-micro.c | 93 msg.tx_data[2] = (u8) DIV_ROUND_CLOSEST(*delay_on, 100); in micro_leds_blink_set() 97 msg.tx_data[3] = (u8) DIV_ROUND_CLOSEST(*delay_off, 100); in micro_leds_blink_set()
|
| /Linux-v5.4/arch/arm/mach-footbridge/ |
| D | dc21285-timer.c | 117 unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16); in footbridge_timer_init() 134 unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16); in footbridge_sched_clock()
|
| /Linux-v5.4/drivers/pwm/ |
| D | pwm-bcm2835.c | 74 scaler = DIV_ROUND_CLOSEST(NSEC_PER_SEC, rate); in bcm2835_pwm_config() 75 period = DIV_ROUND_CLOSEST(period_ns, scaler); in bcm2835_pwm_config() 80 writel(DIV_ROUND_CLOSEST(duty_ns, scaler), in bcm2835_pwm_config()
|
| /Linux-v5.4/drivers/media/rc/ |
| D | ir-rx51.c | 46 int duty, period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, ir_rx51->freq); in init_timing_params() 48 duty = DIV_ROUND_CLOSEST(ir_rx51->duty_cycle * period, 100); in init_timing_params() 244 ir_rx51.freq = DIV_ROUND_CLOSEST(pwm_get_period(pwm), NSEC_PER_SEC); in ir_rx51_probe()
|
| D | pwm-ir-tx.c | 60 period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, pwm_ir->carrier); in pwm_ir_tx() 61 duty = DIV_ROUND_CLOSEST(pwm_ir->duty_cycle * period, 100); in pwm_ir_tx()
|
| /Linux-v5.4/drivers/clocksource/ |
| D | timer-efm32.c | 164 DIV_ROUND_CLOSEST(rate, 1024), 200, 16, in efm32_clocksource_init() 227 clock_event_ddata.periodic_top = DIV_ROUND_CLOSEST(rate, 1024 * HZ); in efm32_clockevent_init() 230 DIV_ROUND_CLOSEST(rate, 1024), in efm32_clockevent_init()
|
| /Linux-v5.4/drivers/clk/mvebu/ |
| D | dove-divider.c | 72 divider = DIV_ROUND_CLOSEST(parent_rate, rate); in dove_calc_divider() 103 unsigned long rate = DIV_ROUND_CLOSEST(parent, divider); in dove_recalc_rate() 122 rate = DIV_ROUND_CLOSEST(parent_rate, divider); in dove_round_rate()
|
| /Linux-v5.4/drivers/clk/meson/ |
| D | clk-dualdiv.c | 41 return DIV_ROUND_CLOSEST(parent_rate, p->n1); in __dualdiv_param_to_rate() 43 return DIV_ROUND_CLOSEST(parent_rate * (p->m1 + p->m2), in __dualdiv_param_to_rate()
|