Home
last modified time | relevance | path

Searched refs:denom (Results 1 – 25 of 32) sorted by relevance

12

/openbmc/u-boot/lib/
H A Dldiv.c12 ldiv (long int numer, long int denom) in ldiv() argument
16 result.quot = numer / denom; in ldiv()
17 result.rem = numer % denom; in ldiv()
38 result.rem -= denom; in ldiv()
/openbmc/u-boot/drivers/i2c/
H A Dsh_i2c.c207 int num, denom, tmp; in sh_i2c_init() local
219 denom = speed * (CONFIG_SH_I2C_DATA_HIGH + CONFIG_SH_I2C_DATA_LOW); in sh_i2c_init()
220 tmp = num * 10 / denom; in sh_i2c_init()
222 iccl = (u16)((num/denom) + 1); in sh_i2c_init()
224 iccl = (u16)(num/denom); in sh_i2c_init()
229 tmp = num * 10 / denom; in sh_i2c_init()
231 icch = (u16)((num/denom) + 1); in sh_i2c_init()
233 icch = (u16)(num/denom); in sh_i2c_init()
H A Drcar_iic.c201 int clkrate, denom; in rcar_iic_set_speed() local
213 denom = speed * (ratio_high + ratio_low); in rcar_iic_set_speed()
214 priv->iccl = DIV_ROUND_CLOSEST(clkrate * ratio_low, denom); in rcar_iic_set_speed()
215 priv->icch = DIV_ROUND_CLOSEST(clkrate * ratio_high, denom); in rcar_iic_set_speed()
/openbmc/linux/drivers/clk/
H A Dclk-xgene.c225 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()
343 u8 width, u64 denom, u32 clk_flags, spinlock_t *lock) in xgene_register_clk_pmd() argument
362 fd->denom = denom; in xgene_register_clk_pmd()
383 u64 denom; in xgene_pmdclk_init() local
[all …]
H A Dclk-si5351.c451 unsigned long rfrac, denom, a, b, c; in si5351_pll_determine_rate() local
468 denom = 1000 * 1000; in si5351_pll_determine_rate()
470 lltmp *= denom; in si5351_pll_determine_rate()
477 rational_best_approximation(rfrac, denom, in si5351_pll_determine_rate()
697 unsigned long rfrac, denom; in si5351_msynth_determine_rate() local
713 denom = 1000 * 1000; in si5351_msynth_determine_rate()
715 lltmp *= denom; in si5351_msynth_determine_rate()
722 rational_best_approximation(rfrac, denom, in si5351_msynth_determine_rate()
H A Dclk-versaclock7.c783 u64 numer, denom, hi, lo, divisor; in vc7_calc_fod_1st_stage_rate() local
786 denom = BIT_ULL(VC7_FOD_DENOMINATOR_BITS); in vc7_calc_fod_1st_stage_rate()
789 vc7_64_mul_64_to_128(parent_rate, denom, &hi, &lo); in vc7_calc_fod_1st_stage_rate()
790 divisor = ((u64)fod_1st_int * denom) + numer; in vc7_calc_fod_1st_stage_rate()
/openbmc/linux/drivers/gpu/drm/ingenic/
H A Dingenic-ipu.c234 unsigned int denom) in ingenic_ipu_set_downscale_coefs() argument
236 unsigned int i, offset, weight, weight_num = denom; in ingenic_ipu_set_downscale_coefs()
241 weight_num += denom * 2; in ingenic_ipu_set_downscale_coefs()
266 unsigned int denom) in ingenic_ipu_set_upscale_coefs() argument
272 weight_num += denom; in ingenic_ipu_set_upscale_coefs()
284 unsigned int num, unsigned int denom) in ingenic_ipu_set_coefs() argument
289 if (denom > num) in ingenic_ipu_set_coefs()
290 ingenic_ipu_set_downscale_coefs(ipu, reg, num, denom); in ingenic_ipu_set_coefs()
291 else if (denom == 1) in ingenic_ipu_set_coefs()
294 ingenic_ipu_set_upscale_coefs(ipu, reg, num, denom); in ingenic_ipu_set_coefs()
[all …]
/openbmc/u-boot/drivers/clk/altera/
H A Dclk-arria10.c121 ulong rate = 0, reg, numer, denom; in socfpga_a10_clk_get_rate() local
133 denom = (reg >> CLKMGR_MAINPLL_VCO1_DENOM_LSB) & in socfpga_a10_clk_get_rate()
136 rate /= denom + 1; in socfpga_a10_clk_get_rate()
141 denom = (reg >> CLKMGR_PERPLL_VCO1_DENOM_LSB) & in socfpga_a10_clk_get_rate()
144 rate /= denom + 1; in socfpga_a10_clk_get_rate()
/openbmc/u-boot/include/linux/
H A Dkernel.h122 #define mult_frac(x, numer, denom)( \ argument
124 typeof(x) quot = (x) / (denom); \
125 typeof(x) rem = (x) % (denom); \
126 (quot * (numer)) + ((rem * (numer)) / (denom)); \
/openbmc/linux/drivers/clk/baikal-t1/
H A Dccu-pll.c172 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()
/openbmc/u-boot/arch/arm/mach-socfpga/
H A Dclock_manager_arria10.c441 u32 denom; in cm_calculate_numer() local
448 denom = main_cfg->vco1_denom; in cm_calculate_numer()
454 denom = main_cfg->vco1_denom; in cm_calculate_numer()
460 denom = per_cfg->vco1_denom; in cm_calculate_numer()
466 denom = per_cfg->vco1_denom; in cm_calculate_numer()
472 (1 + denom) - 1; in cm_calculate_numer()
/openbmc/u-boot/arch/arm/mach-imx/mx7ulp/
H A Dscg.c472 u32 num, denom; in decode_pll() local
502 denom = readl(&scg1_regs->splldenom); in decode_pll()
506 return infreq * mult + infreq * num / denom; in decode_pll()
531 denom = readl(&scg1_regs->aplldenom); in decode_pll()
535 return infreq * mult + infreq * num / denom; in decode_pll()
/openbmc/linux/drivers/thermal/
H A Drockchip_thermal.c553 unsigned int denom; in rk_tsadcv2_temp_to_code() local
582 denom = table->id[mid + 1].temp - table->id[mid].temp; in rk_tsadcv2_temp_to_code()
586 return table->id[mid].code - (num / denom); in rk_tsadcv2_temp_to_code()
588 return table->id[mid].code + (num / denom); in rk_tsadcv2_temp_to_code()
607 unsigned long denom; in rk_tsadcv2_code_to_temp() local
659 denom = abs(table->id[mid - 1].code - table->id[mid].code); in rk_tsadcv2_code_to_temp()
660 *temp = table->id[mid - 1].temp + (num / denom); in rk_tsadcv2_code_to_temp()
/openbmc/u-boot/arch/arm/dts/
H A Dsocfpga_arria10_socdk_sdmmc_handoff.dtsi74 vco1-denom = <1>; /* Field: vco1.denom */
103 vco1-denom = <1>; /* Field: vco1.denom */
/openbmc/linux/net/dccp/ccids/
H A Dccid2.c320 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()
/openbmc/linux/drivers/video/fbdev/aty/
H A Dradeon_base.c580 int hTotal, vTotal, num, denom, m, n; in radeon_probe_pll_params() local
627 denom = 1; in radeon_probe_pll_params()
633 denom = 2*m; in radeon_probe_pll_params()
639 denom = 2*m; in radeon_probe_pll_params()
650 denom *= m; in radeon_probe_pll_params()
654 denom *= 2; in radeon_probe_pll_params()
657 denom *= 4; in radeon_probe_pll_params()
660 denom *= 8; in radeon_probe_pll_params()
663 denom *= 3; in radeon_probe_pll_params()
666 denom *= 6; in radeon_probe_pll_params()
[all …]
/openbmc/linux/drivers/gpu/drm/amd/display/dc/dcn30/
H A Ddcn30_hwseq.c793 unsigned int denom = refresh_hz * 6528; in dcn30_apply_idle_power_optimizations() local
797 (100LL + dc->debug.mall_additional_timer_percent) + denom - 1), in dcn30_apply_idle_power_optimizations()
798 denom) - 64LL; in dcn30_apply_idle_power_optimizations()
819 denom *= 2; in dcn30_apply_idle_power_optimizations()
821 (100LL + dc->debug.mall_additional_timer_percent) + denom - 1), in dcn30_apply_idle_power_optimizations()
822 denom) - 64LL; in dcn30_apply_idle_power_optimizations()
/openbmc/linux/drivers/scsi/
H A Dscsi_transport_spi.c87 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()
/openbmc/linux/drivers/net/wireless/intel/iwlegacy/
H A D4965.c553 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()
/openbmc/linux/tools/testing/selftests/hid/tests/
H A Dtest_wacom_generic.py811 self.empty_pad_sync(num=3, denom=16, reverse=True)
813 def empty_pad_sync(self, num, denom, reverse): argument
829 value += num * delta // denom
/openbmc/linux/drivers/media/test-drivers/vivid/
H A Dvivid-vid-cap.c1429 u32 *num, u32 *denom) in find_aspect_ratio() argument
1433 *denom = 3; in find_aspect_ratio()
1436 *denom = 9; in find_aspect_ratio()
1439 *denom = 10; in find_aspect_ratio()
1442 *denom = 4; in find_aspect_ratio()
1445 *denom = 9; in find_aspect_ratio()
1448 *denom = 9; in find_aspect_ratio()
/openbmc/u-boot/arch/arm/mach-imx/mx7/
H A Dclock.c107 u32 num, denom; in decode_pll() local
161 denom = ccm_anatop->pll_ddr_denom; in decode_pll()
169 return infreq * (div_sel + num / denom); in decode_pll()
/openbmc/linux/drivers/media/dvb-frontends/
H A Ddib7000p.c1800 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()
/openbmc/linux/drivers/media/tuners/
H A Dmt2063.c1403 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()
/openbmc/linux/drivers/tty/serial/
H A Dimx.c1681 unsigned long num, denom, old_ubir, old_ubmr; in imx_uart_set_termios() local
1790 1 << 16, 1 << 16, &num, &denom); in imx_uart_set_termios()
1794 do_div(tdiv64, denom * 16 * div); in imx_uart_set_termios()
1799 denom -= 1; in imx_uart_set_termios()
1816 if (old_ubir != num || old_ubmr != denom) { in imx_uart_set_termios()
1818 imx_uart_writel(sport, denom, UBMR); in imx_uart_set_termios()

12