/linux/drivers/clk/ |
A D | clk-xgene.c | 225 u64 denom; member 260 scale = fd->denom - scale; in xgene_clk_pmd_recalc_rate() 265 do_div(ret, fd->denom); in xgene_clk_pmd_recalc_rate() 283 ret = rate * fd->denom; in xgene_clk_pmd_round_rate() 287 do_div(ret, fd->denom); in xgene_clk_pmd_round_rate() 306 ret = rate * fd->denom; in xgene_clk_pmd_set_rate() 311 scale = fd->denom - scale; in xgene_clk_pmd_set_rate() 362 fd->denom = denom; in xgene_register_clk_pmd() 383 u64 denom; in xgene_pmdclk_init() local 404 denom = BIT(XGENE_CLK_PMD_WIDTH); in xgene_pmdclk_init() [all …]
|
A D | clk-si5351.c | 450 unsigned long rfrac, denom, a, b, c; in si5351_pll_round_rate() local 467 denom = 1000 * 1000; in si5351_pll_round_rate() 469 lltmp *= denom; in si5351_pll_round_rate() 476 rational_best_approximation(rfrac, denom, in si5351_pll_round_rate() 694 unsigned long rfrac, denom; in si5351_msynth_round_rate() local 710 denom = 1000 * 1000; in si5351_msynth_round_rate() 712 lltmp *= denom; in si5351_msynth_round_rate() 719 rational_best_approximation(rfrac, denom, in si5351_msynth_round_rate()
|
/linux/drivers/gpu/drm/ingenic/ |
A D | ingenic-ipu.c | 198 unsigned int denom) in ingenic_ipu_set_downscale_coefs() argument 200 unsigned int i, offset, weight, weight_num = denom; in ingenic_ipu_set_downscale_coefs() 205 weight_num += denom * 2; in ingenic_ipu_set_downscale_coefs() 230 unsigned int denom) in ingenic_ipu_set_upscale_coefs() argument 236 weight_num += denom; in ingenic_ipu_set_upscale_coefs() 248 unsigned int num, unsigned int denom) in ingenic_ipu_set_coefs() argument 253 if (denom > num) in ingenic_ipu_set_coefs() 255 else if (denom == 1) in ingenic_ipu_set_coefs() 258 ingenic_ipu_set_upscale_coefs(ipu, reg, num, denom); in ingenic_ipu_set_coefs() 263 unsigned long d = gcd(*num, *denom); in reduce_fraction() [all …]
|
/linux/include/linux/ |
A D | math.h | 113 #define mult_frac(x, numer, denom)( \ argument 115 typeof(x) quot = (x) / (denom); \ 116 typeof(x) rem = (x) % (denom); \ 117 (quot * (numer)) + ((rem * (numer)) / (denom)); \
|
/linux/drivers/clk/baikal-t1/ |
A D | ccu-pll.c | 172 unsigned long num, denom, n1, d1, nri; in ccu_pll_calc_factors() local 192 denom = parent_rate / nri; in ccu_pll_calc_factors() 201 nf_max = min(CCU_PLL_FVCO_MAX / denom, CCU_PLL_NF_MAX); in ccu_pll_calc_factors() 208 if (num / denom >= nf_max) { in ccu_pll_calc_factors() 211 } else if (denom / num >= od_max) { in ccu_pll_calc_factors() 215 rational_best_approximation(num, denom, nf_max, od_max, in ccu_pll_calc_factors()
|
/linux/drivers/thermal/ |
A D | rockchip_thermal.c | 531 unsigned int denom; in rk_tsadcv2_temp_to_code() local 560 denom = table->id[mid + 1].temp - table->id[mid].temp; in rk_tsadcv2_temp_to_code() 564 return table->id[mid].code - (num / denom); in rk_tsadcv2_temp_to_code() 566 return table->id[mid].code + (num / denom); in rk_tsadcv2_temp_to_code() 585 unsigned long denom; in rk_tsadcv2_code_to_temp() local 637 denom = abs(table->id[mid - 1].code - table->id[mid].code); in rk_tsadcv2_code_to_temp() 638 *temp = table->id[mid - 1].temp + (num / denom); in rk_tsadcv2_code_to_temp()
|
/linux/net/dccp/ccids/ |
A D | ccid2.c | 320 int denom = dp->dccps_l_ack_ratio * dp->dccps_l_ack_ratio - in ccid2_hc_tx_packet_sent() 323 denom = hc->tx_cwnd * hc->tx_cwnd / denom; in ccid2_hc_tx_packet_sent() 325 if (hc->tx_arsent >= denom) { in ccid2_hc_tx_packet_sent()
|
/linux/drivers/video/fbdev/aty/ |
A D | radeon_base.c | 626 denom = 1; in radeon_probe_pll_params() 632 denom = 2*m; in radeon_probe_pll_params() 638 denom = 2*m; in radeon_probe_pll_params() 649 denom *= m; in radeon_probe_pll_params() 653 denom *= 2; in radeon_probe_pll_params() 656 denom *= 4; in radeon_probe_pll_params() 659 denom *= 8; in radeon_probe_pll_params() 662 denom *= 3; in radeon_probe_pll_params() 665 denom *= 6; in radeon_probe_pll_params() 668 denom *= 12; in radeon_probe_pll_params() [all …]
|
/linux/drivers/gpu/drm/amd/display/dc/dcn30/ |
A D | dcn30_hwseq.c | 823 unsigned int denom = refresh_hz * 6528; in dcn30_apply_idle_power_optimizations() local 827 (100LL + dc->debug.mall_additional_timer_percent) + denom - 1), in dcn30_apply_idle_power_optimizations() 828 denom) - 64LL; in dcn30_apply_idle_power_optimizations() 849 denom *= 2; in dcn30_apply_idle_power_optimizations() 851 (100LL + dc->debug.mall_additional_timer_percent) + denom - 1), in dcn30_apply_idle_power_optimizations() 852 denom) - 64LL; in dcn30_apply_idle_power_optimizations()
|
/linux/drivers/scsi/ |
A D | scsi_transport_spi.c | 87 static int sprint_frac(char *dest, int value, int denom) in sprint_frac() argument 89 int frac = value % denom; in sprint_frac() 90 int result = sprintf(dest, "%d", value / denom); in sprint_frac() 97 denom /= 10; in sprint_frac() 98 sprintf(dest + result, "%d", frac / denom); in sprint_frac() 100 frac %= denom; in sprint_frac()
|
A D | scsi_debug.c | 7544 int denom = (flags & F_SYNC_DELAY) ? 20 : 1; in scsi_debug_queuecommand() local 7546 jdelay = mult_frac(USER_HZ * jdelay, HZ, denom * USER_HZ); in scsi_debug_queuecommand()
|
/linux/drivers/net/wireless/intel/iwlegacy/ |
A D | 4965.c | 553 il4965_math_div_round(s32 num, s32 denom, s32 * res) in il4965_math_div_round() argument 561 if (denom < 0) { in il4965_math_div_round() 563 denom = -denom; in il4965_math_div_round() 565 *res = ((num * 2 + denom) / (denom * 2)) * sign; in il4965_math_div_round()
|
/linux/drivers/media/test-drivers/vivid/ |
A D | vivid-vid-cap.c | 1653 u32 *num, u32 *denom) in find_aspect_ratio() argument 1657 *denom = 3; in find_aspect_ratio() 1660 *denom = 9; in find_aspect_ratio() 1663 *denom = 10; in find_aspect_ratio() 1666 *denom = 4; in find_aspect_ratio() 1669 *denom = 9; in find_aspect_ratio() 1672 *denom = 9; in find_aspect_ratio()
|
/linux/drivers/media/dvb-frontends/ |
A D | dib7000p.c | 1800 u32 tmp, denom; in dib7000p_get_time_us() local 1871 denom = bits_per_symbol * rate_num * fft_div * 384; in dib7000p_get_time_us() 1879 if (!denom) in dib7000p_get_time_us() 1887 time_us += denom / 2; in dib7000p_get_time_us() 1888 do_div(time_us, denom); in dib7000p_get_time_us() 2441 u32 denom = P_Kout; in dib7090_calcSyncFreq() local 2442 u32 syncFreq = ((nom << quantif) / denom); in dib7090_calcSyncFreq()
|
A D | dib8000.c | 1384 u32 denom = P_Kout; in dib8096p_calcSyncFreq() local 1385 u32 syncFreq = ((nom << quantif) / denom); in dib8096p_calcSyncFreq() 4013 u32 tmp, denom; in dib8000_get_time_us() local 4054 denom = 0; in dib8000_get_time_us() 4100 denom += bits_per_symbol * rate_num * fft_div * nsegs * 384; in dib8000_get_time_us() 4104 if (!denom) in dib8000_get_time_us() 4112 time_us += denom / 2; in dib8000_get_time_us() 4113 do_div(time_us, denom); in dib8000_get_time_us()
|
/linux/drivers/media/tuners/ |
A D | mt2063.c | 1403 static u32 MT2063_fLO_FractionalTerm(u32 f_ref, u32 num, u32 denom) in MT2063_fLO_FractionalTerm() argument 1406 u32 term1 = t1 / denom; in MT2063_fLO_FractionalTerm() 1407 u32 loss = t1 % denom; in MT2063_fLO_FractionalTerm() 1409 (((f_ref & 0x00003FFF) * num + (loss << 14)) + (denom / 2)) / denom; in MT2063_fLO_FractionalTerm()
|
/linux/drivers/tty/serial/ |
A D | imx.c | 1618 unsigned long num, denom, old_ubir, old_ubmr; in imx_uart_set_termios() local 1727 1 << 16, 1 << 16, &num, &denom); in imx_uart_set_termios() 1731 do_div(tdiv64, denom * 16 * div); in imx_uart_set_termios() 1736 denom -= 1; in imx_uart_set_termios() 1753 if (old_ubir != num || old_ubmr != denom) { in imx_uart_set_termios() 1755 imx_uart_writel(sport, denom, UBMR); in imx_uart_set_termios()
|
/linux/drivers/net/wireless/intersil/orinoco/ |
A D | wext.c | 440 int denom = 1; in orinoco_ioctl_setfreq() local 445 denom *= 10; in orinoco_ioctl_setfreq() 447 chan = ieee80211_frequency_to_channel(frq->m / denom); in orinoco_ioctl_setfreq()
|
/linux/drivers/gpu/drm/amd/display/dc/dcn10/ |
A D | dcn10_hw_sequencer.c | 1981 uint64_t num, denom; in reduceSizeAndFraction() local 2001 denom = *denominator; in reduceSizeAndFraction() 2006 num <= max_int32 && denom <= max_int32) { in reduceSizeAndFraction() 2012 denom_result = div_u64_rem(denom, prime_numbers[i], &denom_remainder); in reduceSizeAndFraction() 2015 denom = denom_result; in reduceSizeAndFraction() 2020 *denominator = denom; in reduceSizeAndFraction()
|
/linux/sound/soc/codecs/ |
A D | wcd938x.c | 3116 int32_t denom; in wcd938x_mbhc_get_result_params() local 3143 denom = (x1 * d1) - (1 << (14 - noff)); in wcd938x_mbhc_get_result_params() 3144 if (denom > 0) in wcd938x_mbhc_get_result_params() 3145 *zdet = (WCD938X_MBHC_ZDET_CONST * 1000) / denom; in wcd938x_mbhc_get_result_params()
|
A D | wcd934x.c | 2677 int32_t denom; in wcd934x_mbhc_get_result_params() local 2704 denom = (x1 * d1) - (1 << (14 - noff)); in wcd934x_mbhc_get_result_params() 2705 if (denom > 0) in wcd934x_mbhc_get_result_params() 2706 *zdet = (WCD934X_MBHC_ZDET_CONST * 1000) / denom; in wcd934x_mbhc_get_result_params()
|
/linux/drivers/hid/ |
A D | wacom_wac.c | 1783 int value, int num, int denom) in wacom_offset_rotation() argument 1788 value += num*range/denom; in wacom_offset_rotation()
|