Searched refs:DIV_ROUND_CLOSEST (Results 1 - 25 of 480) sorted by relevance

1234567891011>>

/linux-master/include/linux/
H A Dunits.h66 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DEGREE);
73 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DEGREE);
80 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DECIDEGREE);
104 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DECIDEGREE);
109 return t + DIV_ROUND_CLOSEST(ABSOLUTE_ZERO_MILLICELSIUS,
115 return t - DIV_ROUND_CLOSEST(ABSOLUTE_ZERO_MILLICELSIUS,
H A Dutil_macros.h13 if (__fc_x op DIV_ROUND_CLOSEST(__fc_a[__fc_i] + \
/linux-master/drivers/clk/
H A Dclk-clps711x.c74 f_spi = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 96);
76 f_pwm = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 128);
83 f_spi = DIV_ROUND_CLOSEST(f_cpu, 576);
84 f_pwm = DIV_ROUND_CLOSEST(f_cpu, 768);
89 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 26);
91 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 24);
93 f_tim = DIV_ROUND_CLOSEST(f_cpu, 144);
/linux-master/drivers/gpu/drm/nouveau/nvkm/subdev/volt/
H A Dgk20a.c56 mv = DIV_ROUND_CLOSEST(coef->c2 * speedo, s_scale);
57 mv = DIV_ROUND_CLOSEST((mv + coef->c1) * speedo, s_scale) + coef->c0;
74 mv = DIV_ROUND_CLOSEST(coef->c3 * speedo, s_scale) + coef->c4 +
75 DIV_ROUND_CLOSEST(coef->c5 * temp, t_scale);
76 mv = DIV_ROUND_CLOSEST(mv * temp, t_scale) + cvb_mv;
/linux-master/drivers/gpu/drm/vkms/
H A Dvkms_formats.c165 dst_pixels[3] = DIV_ROUND_CLOSEST(in_pixel->a, 257);
166 dst_pixels[2] = DIV_ROUND_CLOSEST(in_pixel->r, 257);
167 dst_pixels[1] = DIV_ROUND_CLOSEST(in_pixel->g, 257);
168 dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
174 dst_pixels[2] = DIV_ROUND_CLOSEST(in_pixel->r, 257);
175 dst_pixels[1] = DIV_ROUND_CLOSEST(in_pixel->g, 257);
176 dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
/linux-master/drivers/clk/sunxi-ng/
H A Dccu_phase.c52 step = DIV_ROUND_CLOSEST(360, parent_div);
104 step = DIV_ROUND_CLOSEST(360, parent_div);
105 delay = DIV_ROUND_CLOSEST(degrees, step);
/linux-master/drivers/hwmon/pmbus/
H A Dxdpe12284.c52 return 1 + DIV_ROUND_CLOSEST(val - 500, 10);
56 return 1 + DIV_ROUND_CLOSEST(val - 250, 5);
60 return 1 + DIV_ROUND_CLOSEST(val - 200, 10);
64 return DIV_ROUND_CLOSEST((1550 - val) * 100,
H A Dmp2888.c121 ret = DIV_ROUND_CLOSEST(ret * 200 - 19600, data->curr_sense_gain);
214 ret = data->total_curr_resolution ? ret : DIV_ROUND_CLOSEST(ret, 2);
270 word = DIV_ROUND_CLOSEST(word, MP2888_TEMP_UNIT);
276 word = data->total_curr_resolution ? DIV_ROUND_CLOSEST(word, 8) :
277 DIV_ROUND_CLOSEST(word, 4);
283 word = data->total_curr_resolution ? DIV_ROUND_CLOSEST(word, 4) :
284 DIV_ROUND_CLOSEST(word, 2);
H A Dlm25066.c254 ret = DIV_ROUND_CLOSEST(ret * 293, 6140);
258 ret = DIV_ROUND_CLOSEST(ret * 2832, 45400);
262 ret = DIV_ROUND_CLOSEST(ret * 70, 453);
267 ret = DIV_ROUND_CLOSEST(ret * 725, 2180);
335 ret = DIV_ROUND_CLOSEST(ret * 293, 6140);
343 ret = DIV_ROUND_CLOSEST(ret * 293, 6140);
411 word = DIV_ROUND_CLOSEST((int)word * 6140, 293);
418 word = DIV_ROUND_CLOSEST((int)word * 6140, 293);
/linux-master/drivers/leds/
H A Dleds-ipaq-micro.c93 msg.tx_data[2] = (u8) DIV_ROUND_CLOSEST(*delay_on, 100);
97 msg.tx_data[3] = (u8) DIV_ROUND_CLOSEST(*delay_off, 100);
/linux-master/drivers/hwmon/
H A Dmc13783-adc.c79 val = DIV_ROUND_CLOSEST(val * 9, 2);
85 val = DIV_ROUND_CLOSEST(val * 9, 4) + 2400;
104 val = DIV_ROUND_CLOSEST(val * 9, 4);
123 val = DIV_ROUND_CLOSEST(val * 4800, 1024);
126 val = DIV_ROUND_CLOSEST(val * 2555, 1024);
149 ret = DIV_ROUND_CLOSEST(-2635920 + val * 4244, 10);
H A Dads7828.c66 DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000));
133 vref_mv = DIV_ROUND_CLOSEST(vref_uv, 1000);
152 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096);
156 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256);
H A Dlan966x-hwmon.c147 tmp = DIV_ROUND_CLOSEST(hwmon->clk_rate, 256);
148 *val = DIV_ROUND_CLOSEST(tmp, data);
194 val = DIV_ROUND_CLOSEST(hwmon->clk_rate, val);
195 val = DIV_ROUND_CLOSEST(val, 256) - 1;
307 div = DIV_ROUND_CLOSEST(hwmon->clk_rate, LAN966X_PVT_CLK);
H A Dina2xx.c162 return DIV_ROUND_CLOSEST(avg * INA226_TOTAL_CONV_TIME_DEFAULT, 1000);
173 avg = DIV_ROUND_CLOSEST(interval * 1000,
272 val = DIV_ROUND_CLOSEST((s16)regval, data->config->shunt_div);
277 val = DIV_ROUND_CLOSEST(val, 1000);
285 val = DIV_ROUND_CLOSEST(val, 1000);
354 val = DIV_ROUND_CLOSEST(val, data->config->bus_voltage_lsb);
357 val = DIV_ROUND_CLOSEST(val, data->power_lsb_uW);
462 unsigned int dividend = DIV_ROUND_CLOSEST(1000000000,
469 data->current_lsb_uA = DIV_ROUND_CLOSEST(dividend, val);
H A Dtmp513.c208 *val = DIV_ROUND_CLOSEST(*val * 10 * MILLI, data->shunt_uohms);
224 *val = DIV_ROUND_CLOSEST(*val, MILLI);
236 *val = DIV_ROUND_CLOSEST(*val * 625, 10);
264 val = DIV_ROUND_CLOSEST(val * data->shunt_uohms, 10 * MILLI);
274 val = clamp_val(DIV_ROUND_CLOSEST(val, 4), 0, max_val);
278 regval = clamp_val(DIV_ROUND_CLOSEST(val, data->pwr_lsb_uw), 0,
287 regval = DIV_ROUND_CLOSEST(val * 10, 625) << TMP51X_TEMP_SHIFT;
292 regval = DIV_ROUND_CLOSEST(val, 500);
566 DIV_ROUND_CLOSEST(40960, div));
H A Dwm831x-hwmon.c41 return sprintf(buf, "%d\n", DIV_ROUND_CLOSEST(ret, 1000));
57 ret = DIV_ROUND_CLOSEST(ret * 10000, 10983);
/linux-master/arch/arm/mach-footbridge/
H A Ddc21285-timer.c110 unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16);
129 unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16);
/linux-master/arch/x86/kernel/
H A Dtsc_msr.c199 freq = DIV_ROUND_CLOSEST(tscref, md->divider);
204 res = DIV_ROUND_CLOSEST(tscref * ratio, md->divider);
/linux-master/arch/arm/mach-rpc/
H A Dtime.c25 #define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ)
/linux-master/include/drm/
H A Ddrm_color_mgmt.h49 return DIV_ROUND_CLOSEST(user_input * ((1 << bit_precision) - 1),
/linux-master/drivers/media/rc/
H A Dmeson-ir-tx.c81 unsigned int cnt = DIV_ROUND_CLOSEST(ir->clk_rate, ir->carrier);
82 unsigned int pulse_cnt = DIV_ROUND_CLOSEST(cnt * ir->duty_cycle, 100);
116 unsigned int tb_us = DIV_ROUND_CLOSEST(USEC_PER_SEC, ir->carrier);
118 delay = (DIV_ROUND_CLOSEST(time, tb_us) - 1) & IRB_DELAY_MASK;
140 delay = (DIV_ROUND_CLOSEST(time, tb_us) - 1) & IRB_DELAY_MASK;
/linux-master/drivers/media/pci/cx23885/
H A Dcx23888-ir.c181 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, freq * 16));
186 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, (divider + 1) * 16);
192 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ,
215 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ / 1000000 * ns, 1000));
221 return DIV_ROUND_CLOSEST(count * 1000,
228 return DIV_ROUND_CLOSEST(count, CX23888_IR_REFCLK_FREQ / 1000000);
241 return DIV_ROUND_CLOSEST((1 << 2) * ((u32) divider + 1) * 1000,
376 if (*carrier_range_low < DIV_ROUND_CLOSEST(c16, 16 + 3)) {
378 *carrier_range_low = DIV_ROUND_CLOSEST(c16, 16 + 4);
381 *carrier_range_low = DIV_ROUND_CLOSEST(c1
[all...]
/linux-master/drivers/media/i2c/cx25840/
H A Dcx25840-ir.c142 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, freq * 16));
147 return DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ, (divider + 1) * 16);
153 return DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ,
176 DIV_ROUND_CLOSEST(CX25840_IR_REFCLK_FREQ / 1000000 * ns, 1000));
182 return DIV_ROUND_CLOSEST(count * 1000,
189 return DIV_ROUND_CLOSEST(count, CX25840_IR_REFCLK_FREQ / 1000000);
202 return DIV_ROUND_CLOSEST((1 << 2) * ((u32) divider + 1) * 1000,
363 if (*carrier_range_low < DIV_ROUND_CLOSEST(c16, 16 + 3)) {
365 *carrier_range_low = DIV_ROUND_CLOSEST(c16, 16 + 4);
368 *carrier_range_low = DIV_ROUND_CLOSEST(c1
[all...]
/linux-master/drivers/clk/rockchip/
H A Dclk-mmc-phase.c69 degrees += DIV_ROUND_CLOSEST(delay_num * factor, 1000000);
129 delay = DIV_ROUND_CLOSEST(delay,
/linux-master/drivers/clk/tegra/
H A Dcvb.c20 mv = DIV_ROUND_CLOSEST(cvb->c2 * speedo, s_scale);
21 mv = DIV_ROUND_CLOSEST((mv + cvb->c1) * speedo, s_scale) + cvb->c0;

Completed in 237 milliseconds

1234567891011>>