| /OK3568_Linux_fs/kernel/include/linux/ |
| H A D | units.h | 35 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DEGREE); in millicelsius_to_kelvin() 42 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DEGREE); in deci_kelvin_to_celsius() 49 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DECIDEGREE); in celsius_to_deci_kelvin() 73 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DECIDEGREE); in millicelsius_to_deci_kelvin() 78 return t + DIV_ROUND_CLOSEST(ABSOLUTE_ZERO_MILLICELSIUS, in kelvin_to_celsius() 84 return t - DIV_ROUND_CLOSEST(ABSOLUTE_ZERO_MILLICELSIUS, in celsius_to_kelvin()
|
| /OK3568_Linux_fs/kernel/drivers/clk/ |
| H A D | clk-clps711x.c | 74 f_spi = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 96); in clps711x_clk_init_dt() 76 f_pwm = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 128); in clps711x_clk_init_dt() 83 f_spi = DIV_ROUND_CLOSEST(f_cpu, 576); in clps711x_clk_init_dt() 84 f_pwm = DIV_ROUND_CLOSEST(f_cpu, 768); in clps711x_clk_init_dt() 89 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 26); in clps711x_clk_init_dt() 91 f_tim = DIV_ROUND_CLOSEST(CLPS711X_EXT_FREQ, 24); in clps711x_clk_init_dt() 93 f_tim = DIV_ROUND_CLOSEST(f_cpu, 144); in clps711x_clk_init_dt()
|
| /OK3568_Linux_fs/u-boot/drivers/clk/ |
| H A D | clk_zynq.c | 198 return DIV_ROUND_CLOSEST(zynq_clk_get_pll_rate(priv, pll), div); in zynq_clk_get_cpu_rate() 210 return DIV_ROUND_CLOSEST(zynq_clk_get_pll_rate(priv, ddrpll_clk), div); in zynq_clk_get_ddr2x_rate() 222 return DIV_ROUND_CLOSEST(zynq_clk_get_pll_rate(priv, ddrpll_clk), div); in zynq_clk_get_ddr3x_rate() 235 return DIV_ROUND_CLOSEST(DIV_ROUND_CLOSEST( in zynq_clk_get_dci_rate() 264 DIV_ROUND_CLOSEST( in zynq_clk_get_peripheral_rate() 265 DIV_ROUND_CLOSEST( in zynq_clk_get_peripheral_rate() 298 new_rate = DIV_ROUND_CLOSEST( in zynq_clk_calc_peripheral_two_divs() 299 DIV_ROUND_CLOSEST(pll_rate, d0), d1); in zynq_clk_calc_peripheral_two_divs() 335 div0 = DIV_ROUND_CLOSEST(pll_rate, rate); in zynq_clk_set_peripheral_rate() 338 new_rate = DIV_ROUND_CLOSEST(rate, div0); in zynq_clk_set_peripheral_rate()
|
| H A D | clk_zynqmp.c | 362 return DIV_ROUND_CLOSEST(pllrate, div); in zynqmp_clk_get_cpu_rate() 385 return DIV_ROUND_CLOSEST(pllrate, div); in zynqmp_clk_get_ddr_rate() 419 DIV_ROUND_CLOSEST( in zynqmp_clk_get_peripheral_rate() 420 DIV_ROUND_CLOSEST(pllrate, div0), div1); in zynqmp_clk_get_peripheral_rate() 433 new_rate = DIV_ROUND_CLOSEST( in zynqmp_clk_calc_peripheral_two_divs() 434 DIV_ROUND_CLOSEST(pll_rate, d0), d1); in zynqmp_clk_calc_peripheral_two_divs() 479 div0 = DIV_ROUND_CLOSEST(pll_rate, rate); in zynqmp_clk_set_peripheral_rate() 482 new_rate = DIV_ROUND_CLOSEST(rate, div0); in zynqmp_clk_set_peripheral_rate()
|
| /OK3568_Linux_fs/kernel/drivers/gpu/drm/i915/display/ |
| H A D | intel_dp_aux_backlight.c | 154 fxp = DIV_ROUND_CLOSEST(KHz(DP_EDP_BACKLIGHT_FREQ_BASE_KHZ), freq); in intel_dp_aux_set_pwm_freq() 155 f = clamp(DIV_ROUND_CLOSEST(fxp, 1 << pn), 1, 255); in intel_dp_aux_set_pwm_freq() 159 fxp_min = DIV_ROUND_CLOSEST(fxp * 3, 4); in intel_dp_aux_set_pwm_freq() 160 fxp_max = DIV_ROUND_CLOSEST(fxp * 5, 4); in intel_dp_aux_set_pwm_freq() 266 fxp = DIV_ROUND_CLOSEST(KHz(DP_EDP_BACKLIGHT_FREQ_BASE_KHZ), freq); in intel_dp_aux_calc_max_backlight() 290 fxp_min = DIV_ROUND_CLOSEST(fxp * 3, 4); in intel_dp_aux_calc_max_backlight() 291 fxp_max = DIV_ROUND_CLOSEST(fxp * 5, 4); in intel_dp_aux_calc_max_backlight() 299 f = clamp(DIV_ROUND_CLOSEST(fxp, 1 << pn), 1, 255); in intel_dp_aux_calc_max_backlight()
|
| /OK3568_Linux_fs/kernel/drivers/gpu/drm/nouveau/nvkm/subdev/volt/ |
| H A 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()
|
| /OK3568_Linux_fs/kernel/drivers/media/i2c/cx25840/ |
| H A 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 …]
|
| /OK3568_Linux_fs/kernel/drivers/hwmon/pmbus/ |
| H A D | lm25066.c | 255 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25066_read_word_data() 259 ret = DIV_ROUND_CLOSEST(ret * 2832, 45400); in lm25066_read_word_data() 263 ret = DIV_ROUND_CLOSEST(ret * 70, 453); in lm25066_read_word_data() 268 ret = DIV_ROUND_CLOSEST(ret * 725, 2180); in lm25066_read_word_data() 336 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25056_read_word_data() 344 ret = DIV_ROUND_CLOSEST(ret * 293, 6140); in lm25056_read_word_data() 415 word = DIV_ROUND_CLOSEST((int)word * 6140, 293); in lm25066_write_word_data() 423 word = DIV_ROUND_CLOSEST((int)word * 6140, 293); in lm25066_write_word_data()
|
| H A D | xdpe12284.c | 50 return 1 + DIV_ROUND_CLOSEST(val - 500, 10); in xdpe122_read_word_data() 54 return 1 + DIV_ROUND_CLOSEST(val - 250, 5); in xdpe122_read_word_data() 58 return 1 + DIV_ROUND_CLOSEST(val - 200, 10); in xdpe122_read_word_data() 62 return DIV_ROUND_CLOSEST((1550 - val) * 100, in xdpe122_read_word_data()
|
| H A D | zl6100.c | 104 mantissa = DIV_ROUND_CLOSEST(val, 1000); in zl6100_d2l() 178 ret = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(ret) * 9, 10)); in zl6100_read_word_data() 181 ret = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(ret) * 11, 10)); in zl6100_read_word_data() 238 word = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(word) * 10, 9)); in zl6100_write_word_data() 247 word = zl6100_d2l(DIV_ROUND_CLOSEST(zl6100_l2d(word) * 10, 11)); in zl6100_write_word_data()
|
| H A D | mp2975.c | 157 return max_t(int, DIV_ROUND_CLOSEST(ret, data->info.phases[page]), in mp2975_read_phase() 158 DIV_ROUND_CLOSEST(ph_curr, data->curr_sense_gain[page])); in mp2975_read_phase() 235 ret = DIV_ROUND_CLOSEST(ret, MP2975_VIN_UV_LIMIT_UNIT); in mp2975_read_word_data() 260 ret = DIV_ROUND_CLOSEST(data->vref[page] * 10 - 50 * in mp2975_read_word_data() 288 ret = DIV_ROUND_CLOSEST(ret, 4); in mp2975_read_word_data() 297 ret = DIV_ROUND_CLOSEST(ret, 4); in mp2975_read_word_data() 654 DIV_ROUND_CLOSEST(data->vref_off[i] * in mp2975_vout_per_rail_config_get()
|
| /OK3568_Linux_fs/kernel/drivers/hwmon/ |
| H A D | tmp513.c | 199 *val = DIV_ROUND_CLOSEST(*val * 10000, data->shunt_uohms); in tmp51x_get_value() 215 *val = DIV_ROUND_CLOSEST(*val, 1000); in tmp51x_get_value() 227 *val = DIV_ROUND_CLOSEST(*val * 625, 10); in tmp51x_get_value() 255 val = DIV_ROUND_CLOSEST(val * data->shunt_uohms, 10000); in tmp51x_set_value() 265 val = clamp_val(DIV_ROUND_CLOSEST(val, 4), 0, max_val); in tmp51x_set_value() 269 regval = clamp_val(DIV_ROUND_CLOSEST(val, data->pwr_lsb_uw), 0, in tmp51x_set_value() 278 regval = DIV_ROUND_CLOSEST(val * 10, 625) << TMP51X_TEMP_SHIFT; in tmp51x_set_value() 283 regval = DIV_ROUND_CLOSEST(val, 500); in tmp51x_set_value() 559 DIV_ROUND_CLOSEST(40960, div)); in tmp51x_calibrate()
|
| H A 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()
|
| H A D | ina2xx.c | 163 return DIV_ROUND_CLOSEST(avg * INA226_TOTAL_CONV_TIME_DEFAULT, 1000); in ina226_reg_to_interval() 174 avg = DIV_ROUND_CLOSEST(interval * 1000, in ina226_interval_to_reg() 273 val = DIV_ROUND_CLOSEST((s16)regval, data->config->shunt_div); in ina2xx_get_value() 278 val = DIV_ROUND_CLOSEST(val, 1000); in ina2xx_get_value() 286 val = DIV_ROUND_CLOSEST(val, 1000); in ina2xx_get_value() 356 val = DIV_ROUND_CLOSEST(val, data->config->bus_voltage_lsb); in ina226_alert_to_reg() 359 val = DIV_ROUND_CLOSEST(val, data->power_lsb_uW); in ina226_alert_to_reg() 464 unsigned int dividend = DIV_ROUND_CLOSEST(1000000000, in ina2xx_set_shunt() 471 data->current_lsb_uA = DIV_ROUND_CLOSEST(dividend, val); in ina2xx_set_shunt()
|
| H A D | ads7828.c | 66 DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000)); in ads7828_in_show() 133 vref_mv = DIV_ROUND_CLOSEST(vref_uv, 1000); in ads7828_probe() 153 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096); in ads7828_probe() 157 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256); in ads7828_probe()
|
| H A D | ltc2947-core.c | 632 DIV_ROUND_CLOSEST(val - 550, 204)); in ltc2947_write_temp() 637 DIV_ROUND_CLOSEST(val - 550, 204)); in ltc2947_write_temp() 647 DIV_ROUND_CLOSEST(val - 550, 204)); in ltc2947_write_temp() 652 DIV_ROUND_CLOSEST(val - 550, 204)); in ltc2947_write_temp() 673 DIV_ROUND_CLOSEST(val, 200000)); in ltc2947_write_power() 678 DIV_ROUND_CLOSEST(val, 200000)); in ltc2947_write_power() 699 DIV_ROUND_CLOSEST(val, 12)); in ltc2947_write_curr() 704 DIV_ROUND_CLOSEST(val, 12)); in ltc2947_write_curr() 736 DIV_ROUND_CLOSEST(val, 145)); in ltc2947_write_in() 742 DIV_ROUND_CLOSEST(val, 2)); in ltc2947_write_in() [all …]
|
| H A 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()
|
| /OK3568_Linux_fs/u-boot/arch/arm/mach-omap2/ |
| H A D | abb.c | 51 sys_rate = DIV_ROUND_CLOSEST(V_OSCK, 1000000); in abb_setup_timings() 52 clk_cycles = DIV_ROUND_CLOSEST(OMAP_ABB_CLOCK_CYCLES * 10, sys_rate); in abb_setup_timings() 53 sr2_cnt = DIV_ROUND_CLOSEST(OMAP_ABB_SETTLING_TIME * 10, clk_cycles); in abb_setup_timings()
|
| /OK3568_Linux_fs/kernel/drivers/media/pci/cx23885/ |
| H A D | cx23888-ir.c | 181 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, freq * 16)); in carrier_freq_to_clock_divider() 186 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, (divider + 1) * 16); in clock_divider_to_carrier_freq() 192 return DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ, in clock_divider_to_freq() 215 DIV_ROUND_CLOSEST(CX23888_IR_REFCLK_FREQ / 1000000 * ns, 1000)); in ns_to_lpf_count() 221 return DIV_ROUND_CLOSEST(count * 1000, in lpf_count_to_ns() 228 return DIV_ROUND_CLOSEST(count, CX23888_IR_REFCLK_FREQ / 1000000); in lpf_count_to_us() 241 return DIV_ROUND_CLOSEST((1 << 2) * ((u32) divider + 1) * 1000, in clock_divider_to_resolution() 376 if (*carrier_range_low < DIV_ROUND_CLOSEST(c16, 16 + 3)) { in control_rx_s_carrier_window() 378 *carrier_range_low = DIV_ROUND_CLOSEST(c16, 16 + 4); in control_rx_s_carrier_window() 381 *carrier_range_low = DIV_ROUND_CLOSEST(c16, 16 + 3); in control_rx_s_carrier_window() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/sunxi-ng/ |
| H A 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()
|
| /OK3568_Linux_fs/u-boot/drivers/video/drm/ |
| H A D | dw_mipi_dsi2.c | 369 tmp = DIV_ROUND_CLOSEST(tmp * 100, 228); in dw_mipi_dsi2_get_lane_rate() 573 phy_hs_clk = DIV_ROUND_CLOSEST(dsi2->lane_hs_rate * MSEC_PER_SEC, 7); in dw_mipi_dsi2_ipi_set() 575 phy_hs_clk = DIV_ROUND_CLOSEST(dsi2->lane_hs_rate * MSEC_PER_SEC, 16); in dw_mipi_dsi2_ipi_set() 578 hsa_time = DIV_ROUND_CLOSEST(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set() 582 hbp_time = DIV_ROUND_CLOSEST(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set() 586 hact_time = DIV_ROUND_CLOSEST(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set() 590 hline_time = DIV_ROUND_CLOSEST(tmp << 16, pixel_clk); in dw_mipi_dsi2_ipi_set() 920 dsi2->lane_hs_rate = DIV_ROUND_CLOSEST(rate, MSEC_PER_SEC); in dw_mipi_dsi2_set_hs_clk() 978 phy_hsclk = DIV_ROUND_CLOSEST(dsi2->lane_hs_rate * MSEC_PER_SEC, 7); in dw_mipi_dsi2_phy_ratio_cfg() 981 phy_hsclk = DIV_ROUND_CLOSEST(dsi2->lane_hs_rate * MSEC_PER_SEC, 16); in dw_mipi_dsi2_phy_ratio_cfg() [all …]
|
| /OK3568_Linux_fs/u-boot/lib/ |
| H A D | strmhz.c | 14 n = DIV_ROUND_CLOSEST(hz, 1000) / 1000L; in strmhz() 18 m = DIV_ROUND_CLOSEST(hz, 1000L); in strmhz()
|
| /OK3568_Linux_fs/kernel/drivers/iio/adc/ |
| H A D | ad7192.c | 499 fadc = DIV_ROUND_CLOSEST(st->fclk, in ad7192_get_available_filter_freq() 501 freq[0] = DIV_ROUND_CLOSEST(fadc * 240, 1024); in ad7192_get_available_filter_freq() 503 fadc = DIV_ROUND_CLOSEST(st->fclk, in ad7192_get_available_filter_freq() 505 freq[1] = DIV_ROUND_CLOSEST(fadc * 240, 1024); in ad7192_get_available_filter_freq() 507 fadc = DIV_ROUND_CLOSEST(st->fclk, AD7192_MODE_RATE(st->mode)); in ad7192_get_available_filter_freq() 508 freq[2] = DIV_ROUND_CLOSEST(fadc * 230, 1024); in ad7192_get_available_filter_freq() 509 freq[3] = DIV_ROUND_CLOSEST(fadc * 272, 1024); in ad7192_get_available_filter_freq() 628 fadc = DIV_ROUND_CLOSEST(st->fclk, in ad7192_get_3db_filter_freq() 632 return DIV_ROUND_CLOSEST(fadc * 240, 1024); in ad7192_get_3db_filter_freq() 634 return DIV_ROUND_CLOSEST(fadc * 272, 1024); in ad7192_get_3db_filter_freq() [all …]
|
| H A D | ad7124.c | 276 odr_sel_bits = DIV_ROUND_CLOSEST(fclk, odr * 32); in ad7124_set_channel_odr() 289 DIV_ROUND_CLOSEST(fclk, odr_sel_bits * 32); in ad7124_set_channel_odr() 323 return DIV_ROUND_CLOSEST(fadc * 230, 1000); in ad7124_get_3db_filter_freq() 325 return DIV_ROUND_CLOSEST(fadc * 262, 1000); in ad7124_get_3db_filter_freq() 340 sinc4_3db_odr = DIV_ROUND_CLOSEST(freq * 1000, 230); in ad7124_set_3db_filter_freq() 341 sinc3_3db_odr = DIV_ROUND_CLOSEST(freq * 1000, 262); in ad7124_set_3db_filter_freq() 439 res = DIV_ROUND_CLOSEST(vref, full_scale); in ad7124_write_raw() 440 gain = DIV_ROUND_CLOSEST(res, val2); in ad7124_write_raw()
|
| /OK3568_Linux_fs/kernel/drivers/clk/at91/ |
| H A D | clk-usb.c | 53 return DIV_ROUND_CLOSEST(parent_rate, (usbdiv + 1)); in at91sam9x5_clk_usb_recalc_rate() 82 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() 314 tmprate = DIV_ROUND_CLOSEST(tmp_parent_rate, usb->divisors[i]); in at91rm9200_clk_usb_round_rate() 343 div = DIV_ROUND_CLOSEST(parent_rate, rate); in at91rm9200_clk_usb_set_rate()
|