Home
last modified time | relevance | path

Searched refs:DIV_ROUND_CLOSEST (Results 1 – 25 of 294) sorted by relevance

12345678910>>...12

/Linux-v4.19/drivers/clk/
Dclk-clps711x.c76 f_spi = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 96); in _clps711x_clk_init()
78 f_pwm = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 128); in _clps711x_clk_init()
85 f_spi = DIV_ROUND_CLOSEST(f_cpu, 576); in _clps711x_clk_init()
86 f_pwm = DIV_ROUND_CLOSEST(f_cpu, 768); in _clps711x_clk_init()
91 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 26); in _clps711x_clk_init()
93 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 24); in _clps711x_clk_init()
95 f_tim = DIV_ROUND_CLOSEST(f_cpu, 144); in _clps711x_clk_init()
/Linux-v4.19/drivers/clk/meson/
Dgxbb-aoclk-32k.c95 f1 = DIV_ROUND_CLOSEST(parent_rate, n1); in aoclk_cec_32k_recalc_rate()
96 f2 = DIV_ROUND_CLOSEST(parent_rate, n2); in aoclk_cec_32k_recalc_rate()
98 p1 = DIV_ROUND_CLOSEST(100000000 * m1, f1 * (m1 + m2)); in aoclk_cec_32k_recalc_rate()
99 p2 = DIV_ROUND_CLOSEST(100000000 * m2, f2 * (m1 + m2)); in aoclk_cec_32k_recalc_rate()
106 return DIV_ROUND_CLOSEST(parent_rate, n1); in aoclk_cec_32k_recalc_rate()
/Linux-v4.19/drivers/gpu/drm/nouveau/nvkm/subdev/volt/
Dgk20a.c56 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-v4.19/drivers/media/pci/cx23885/
Dcx23888-ir.c190 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_clock_divider()
196 return DIV_ROUND_CLOSEST((divider + 1) * 1000, in clock_divider_to_ns()
203 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, freq * 16)); in carrier_freq_to_clock_divider()
208 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, (divider + 1) * 16); in clock_divider_to_carrier_freq()
215 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, freq * rollovers)); in freq_to_clock_divider()
221 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, in clock_divider_to_freq()
244 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_lpf_count()
250 return DIV_ROUND_CLOSEST(count * 1000, in lpf_count_to_ns()
257 return DIV_ROUND_CLOSEST(count, CX23888_IR_REFCLK_FREQ / 1000000); in lpf_count_to_us()
270 return DIV_ROUND_CLOSEST((1 << 2) * ((u32) divider + 1) * 1000, in clock_divider_to_resolution()
[all …]
/Linux-v4.19/drivers/hwmon/pmbus/
Dlm25066.c238 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25066_read_word_data()
242 ret = DIV_ROUND_CLOSEST(ret * 2832, 45400); in lm25066_read_word_data()
246 ret = DIV_ROUND_CLOSEST(ret * 70, 453); in lm25066_read_word_data()
251 ret = DIV_ROUND_CLOSEST(ret * 725, 2180); in lm25066_read_word_data()
305 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25056_read_word_data()
313 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25056_read_word_data()
384 word = DIV_ROUND_CLOSEST((int)word * 6140, 293); in lm25066_write_word_data()
392 word = DIV_ROUND_CLOSEST((int)word * 6140, 293); in lm25066_write_word_data()
Dzl6100.c117 mantissa = DIV_ROUND_CLOSEST(val, 1000); in zl6100_d2l()
190 ret = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(ret) * 9, 10)); in zl6100_read_word_data()
193 ret = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(ret) * 11, 10)); in zl6100_read_word_data()
250 word = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(word) * 10, 9)); in zl6100_write_word_data()
259 word = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(word) * 10, 11)); in zl6100_write_word_data()
/Linux-v4.19/drivers/media/i2c/cx25840/
Dcx25840-ir.c151 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_clock_divider()
157 return DIV_ROUND_CLOSEST((divider + 1) * 1000, in clock_divider_to_ns()
164 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, freq * 16)); in carrier_freq_to_clock_divider()
169 return DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, (divider + 1) * 16); in clock_divider_to_carrier_freq()
176 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, freq * rollovers)); in freq_to_clock_divider()
182 return DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, in clock_divider_to_freq()
205 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_lpf_count()
211 return DIV_ROUND_CLOSEST(count * 1000, in lpf_count_to_ns()
218 return DIV_ROUND_CLOSEST(count, CX25840_IR_REFCLK_FREQ / 1000000); in lpf_count_to_us()
231 return DIV_ROUND_CLOSEST((1 << 2) * ((u32) divider + 1) * 1000, in clock_divider_to_resolution()
[all …]
/Linux-v4.19/drivers/hwmon/
Dina2xx.c155 return DIV_ROUND_CLOSEST(avg * INA226_TOTAL_CONV_TIME_DEFAULT, 1000); in ina226_reg_to_interval()
166 avg = DIV_ROUND_CLOSEST(interval * 1000, in ina226_interval_to_reg()
265 val = DIV_ROUND_CLOSEST((s16)regval, data->config->shunt_div); in ina2xx_get_value()
270 val = DIV_ROUND_CLOSEST(val, 1000); in ina2xx_get_value()
278 val = DIV_ROUND_CLOSEST(val, 1000); in ina2xx_get_value()
317 unsigned int dividend = DIV_ROUND_CLOSEST(1000000000, in ina2xx_set_shunt()
324 data->current_lsb_uA = DIV_ROUND_CLOSEST(dividend, val); in ina2xx_set_shunt()
Dmc13783-adc.c90 val = DIV_ROUND_CLOSEST(val * 9, 2); in mc13783_adc_read_bp()
96 val = DIV_ROUND_CLOSEST(val * 9, 4) + 2400; in mc13783_adc_read_bp()
114 val = DIV_ROUND_CLOSEST(val * 9, 4); in mc13783_adc_read_gp()
132 val = DIV_ROUND_CLOSEST(val * 4800, 1024); in mc13783_adc_read_uid()
135 val = DIV_ROUND_CLOSEST(val * 2555, 1024); in mc13783_adc_read_uid()
157 ret = DIV_ROUND_CLOSEST(-2635920 + val * 4244, 10); in mc13783_adc_read_temp()
Dads7828.c79 DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000)); in ads7828_show_in()
145 vref_mv = DIV_ROUND_CLOSEST(vref_uv, 1000); in ads7828_probe()
165 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096); in ads7828_probe()
169 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256); in ads7828_probe()
Dltc4222.c73 val = DIV_ROUND_CLOSEST(val * 5, 4); in ltc4222_get_value()
78 val = DIV_ROUND_CLOSEST(val * 125, 4); in ltc4222_get_value()
89 val = DIV_ROUND_CLOSEST(val * 125, 2); in ltc4222_get_value()
Dda9052-hwmon.c57 return DIV_ROUND_CLOSEST(value * 2000, 1023) + 2500; in volt_reg_to_mv()
63 return DIV_ROUND_CLOSEST(value * 2500, 1023); in input_reg_to_mv()
69 return DIV_ROUND_CLOSEST(value * 5000, 1023); in vbbat_reg_to_mv()
74 return DIV_ROUND_CLOSEST(value * hwmon->tsiref_mv, 1023); in input_tsireg_to_mv()
133 return sprintf(buf, "%d\n", DIV_ROUND_CLOSEST(ret * 39, 10)); in da9052_read_ich()
Dda9055-hwmon.c124 return DIV_ROUND_CLOSEST(value * 1000, DA9055_VSYS_DIV) + 2500; in volt_reg_to_mv()
126 return DIV_ROUND_CLOSEST(value * 1000, DA9055_ADCIN_DIV); in volt_reg_to_mv()
198 return sprintf(buf, "%d\n", DIV_ROUND_CLOSEST(-4084 * (tjunc - toffset) in da9055_read_tjunc()
/Linux-v4.19/arch/arm/mach-ks8695/
Dtime.c59 u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ); in ks8695_set_periodic()
60 u32 half = DIV_ROUND_CLOSEST(rate, 2); in ks8695_set_periodic()
82 u32 half = DIV_ROUND_CLOSEST(cycles, 2); in ks8695_set_next_event()
/Linux-v4.19/drivers/clk/sunxi-ng/
Dccu_phase.c55 step = DIV_ROUND_CLOSEST(360, parent_div); in ccu_phase_get_phase()
107 step = DIV_ROUND_CLOSEST(360, parent_div); in ccu_phase_set_phase()
108 delay = DIV_ROUND_CLOSEST(degrees, step); in ccu_phase_set_phase()
/Linux-v4.19/drivers/gpu/drm/i915/
Dintel_dp_aux_backlight.c127 fxp = DIV_ROUND_CLOSEST(KHz(DP_EDP_BACKLIGHT_FREQ_BASE_KHZ), freq); in intel_dp_aux_set_pwm_freq()
149 fxp_min = DIV_ROUND_CLOSEST(fxp * 3, 4); in intel_dp_aux_set_pwm_freq()
150 fxp_max = DIV_ROUND_CLOSEST(fxp * 5, 4); in intel_dp_aux_set_pwm_freq()
157 f = clamp(DIV_ROUND_CLOSEST(fxp, 1 << pn), 1, 255); in intel_dp_aux_set_pwm_freq()
/Linux-v4.19/arch/arm/mach-rpc/
Dtime.c28 #define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ)
62 return DIV_ROUND_CLOSEST(offset, RPC_LATCH) * 1000; in ioc_timer_gettimeoffset()
/Linux-v4.19/drivers/leds/
Dleds-ipaq-micro.c95 msg.tx_data[2] = (u8) DIV_ROUND_CLOSEST(*delay_on, 100); in micro_leds_blink_set()
99 msg.tx_data[3] = (u8) DIV_ROUND_CLOSEST(*delay_off, 100); in micro_leds_blink_set()
/Linux-v4.19/drivers/clk/at91/
Dclk-usb.c55 return DIV_ROUND_CLOSEST(parent_rate, (usbdiv + 1)); in at91sam9x5_clk_usb_recalc_rate()
81 tmp_rate = DIV_ROUND_CLOSEST(tmp_parent_rate, div); in at91sam9x5_clk_usb_determine_rate()
141 div = DIV_ROUND_CLOSEST(parent_rate, rate); in at91sam9x5_clk_usb_set_rate()
295 tmprate = DIV_ROUND_CLOSEST(tmp_parent_rate, usb->divisors[i]); in at91rm9200_clk_usb_round_rate()
324 div = DIV_ROUND_CLOSEST(parent_rate, rate); in at91rm9200_clk_usb_set_rate()
Dclk-generated.c107 return DIV_ROUND_CLOSEST(parent_rate, gck->gckdiv + 1); in clk_generated_recalc_rate()
150 min_rate = DIV_ROUND_CLOSEST(parent_rate, GENERATED_MAX_DIV + 1); in clk_generated_determine_rate()
155 div = DIV_ROUND_CLOSEST(parent_rate, req->rate); in clk_generated_determine_rate()
237 div = DIV_ROUND_CLOSEST(parent_rate, rate); in clk_generated_set_rate()
/Linux-v4.19/arch/arm/mach-footbridge/
Ddc21285-timer.c117 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-v4.19/drivers/media/rc/
Dir-rx51.c55 int duty, period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, ir_rx51->freq); in init_timing_params()
57 duty = DIV_ROUND_CLOSEST(ir_rx51->duty_cycle * period, 100); in init_timing_params()
253 ir_rx51.freq = DIV_ROUND_CLOSEST(pwm_get_period(pwm), NSEC_PER_SEC); in ir_rx51_probe()
Dpwm-ir-tx.c68 period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, pwm_ir->carrier); in pwm_ir_tx()
69 duty = DIV_ROUND_CLOSEST(pwm_ir->duty_cycle * period, 100); in pwm_ir_tx()
/Linux-v4.19/drivers/clocksource/
Dtime-efm32.c167 DIV_ROUND_CLOSEST(rate, 1024), 200, 16, in efm32_clocksource_init()
230 clock_event_ddata.periodic_top = DIV_ROUND_CLOSEST(rate, 1024 * HZ); in efm32_clockevent_init()
233 DIV_ROUND_CLOSEST(rate, 1024), in efm32_clockevent_init()
/Linux-v4.19/drivers/clk/mvebu/
Ddove-divider.c72 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()

12345678910>>...12