Home
last modified time | relevance | path

Searched refs:DIV_ROUND_CLOSEST_ULL (Results 1 – 25 of 61) sorted by relevance

123

/Linux-v5.4/kernel/locking/
Dqspinlock_stat.h74 frac = DIV_ROUND_CLOSEST_ULL(frac, kicks); in lockevent_read()
89 sum = DIV_ROUND_CLOSEST_ULL(sum, kicks); in lockevent_read()
/Linux-v5.4/drivers/pwm/
Dpwm-tegra.c81 c = DIV_ROUND_CLOSEST_ULL(c, period_ns); in tegra_pwm_config()
92 hz = DIV_ROUND_CLOSEST_ULL(100ULL * NSEC_PER_SEC, period_ns); in tegra_pwm_config()
93 rate = DIV_ROUND_CLOSEST_ULL(100ULL * rate, hz); in tegra_pwm_config()
Dpwm-sprd.c106 state->period = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); in sprd_pwm_get_state()
111 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); in sprd_pwm_get_state()
139 prescale = DIV_ROUND_CLOSEST_ULL(tmp, SPRD_PWM_MOD_MAX) - 1; in sprd_pwm_config()
Dpwm-imx-tpm.c100 clock_unit = DIV_ROUND_CLOSEST_ULL(tmp, NSEC_PER_SEC); in pwm_imx_tpm_round_state()
116 real_state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_round_state()
129 p->val = DIV_ROUND_CLOSEST_ULL(tmp, real_state->period); in pwm_imx_tpm_round_state()
154 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_get_state()
Dpwm-rockchip.c79 state->period = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in rockchip_pwm_get_state()
83 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in rockchip_pwm_get_state()
117 period = DIV_ROUND_CLOSEST_ULL(div, in rockchip_pwm_config()
121 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
Dpwm-imx27.c150 pwm_clk = DIV_ROUND_CLOSEST_ULL(pwm_clk, prescaler); in pwm_imx27_get_state()
156 state->period = DIV_ROUND_CLOSEST_ULL(tmp, pwm_clk); in pwm_imx27_get_state()
162 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, pwm_clk); in pwm_imx27_get_state()
Dpwm-mediatek.c138 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution); in pwm_mediatek_config()
142 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, in pwm_mediatek_config()
161 cnt_duty = DIV_ROUND_CLOSEST_ULL((u64)duty_ns * 1000, resolution); in pwm_mediatek_config()
Dpwm-omap-dmtimer.c50 return DIV_ROUND_CLOSEST_ULL((u64)clk_rate * ns, NSEC_PER_SEC); in pwm_omap_dmtimer_get_clock_cycles()
169 DIV_ROUND_CLOSEST_ULL((u64)NSEC_PER_SEC * duty_cycles, in pwm_omap_dmtimer_config()
171 DIV_ROUND_CLOSEST_ULL((u64)NSEC_PER_SEC * period_cycles, in pwm_omap_dmtimer_config()
Dpwm-stm32-lp.c182 state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state()
187 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in stm32_pwm_lp_get_state()
Dpwm-zx.c90 state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate); in zx_pwm_get_state()
94 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in zx_pwm_get_state()
Dpwm-sun4i.c141 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in sun4i_pwm_get_state()
144 state->period = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in sun4i_pwm_get_state()
Dpwm-lpss.c99 base_unit = DIV_ROUND_CLOSEST_ULL(freq, c); in pwm_lpss_prepare()
/Linux-v5.4/drivers/clk/bcm/
Dclk-kona.c78 return DIV_ROUND_CLOSEST_ULL(combined, BILLION); in scaled_div_build()
722 scaled_parent_rate = DIV_ROUND_CLOSEST_ULL(scaled_rate, in clk_recalc_rate()
734 result = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, scaled_div); in clk_recalc_rate()
781 scaled_parent_rate = DIV_ROUND_CLOSEST_ULL(scaled_rate, in round_rate()
793 best_scaled_div = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, in round_rate()
806 result = DIV_ROUND_CLOSEST_ULL(scaled_parent_rate, best_scaled_div); in round_rate()
/Linux-v5.4/drivers/clk/at91/
Dclk-sam9x60-pll.c216 tmpfrac = DIV_ROUND_CLOSEST_ULL((u64)remainder * tmpdiv * (1 << 22), in sam9x60_pll_get_best_div_mul()
219 tmprate += DIV_ROUND_CLOSEST_ULL((u64)tmpfrac * parent_rate, in sam9x60_pll_get_best_div_mul()
Dclk-audio-pll.c166 fr = DIV_ROUND_CLOSEST_ULL(fr, AUDIO_PLL_DIV_FRAC); in clk_audio_pll_fout()
234 tmp = DIV_ROUND_CLOSEST_ULL(tmp, parent_rate); in clk_audio_pll_frac_compute_frac()
/Linux-v5.4/drivers/video/backlight/
Dpwm_bl.c174 retval = DIV_ROUND_CLOSEST_ULL(lightness * 10, 9023); in cie1931()
177 retval = DIV_ROUND_CLOSEST_ULL(retval, (scale * scale)); in cie1931()
213 retval = DIV_ROUND_CLOSEST_ULL(retval, PWM_LUMINANCE_SCALE); in pwm_backlight_brightness_default()
/Linux-v5.4/drivers/regulator/
Dpwm-regulator.c175 voltage = DIV_ROUND_CLOSEST_ULL((u64)voltage * diff_uV, diff_duty); in pwm_regulator_get_voltage()
208 dutycycle = DIV_ROUND_CLOSEST_ULL((u64)(req_min_uV - min_uV) * in pwm_regulator_set_voltage()
Dvctrl-regulator.c52 DIV_ROUND_CLOSEST_ULL((s64)(out_uV - out->min_uV) * in vctrl_calc_ctrl_voltage()
74 DIV_ROUND_CLOSEST_ULL((s64)(ctrl_uV - ctrl->min_uV) * in vctrl_calc_output_voltage()
/Linux-v5.4/drivers/clk/meson/
Dclk-pll.c103 val = DIV_ROUND_CLOSEST_ULL(val * frac_max, parent_rate); in __pll_params_with_frac()
152 return DIV_ROUND_CLOSEST_ULL(val, parent_rate); in meson_clk_get_pll_range_m()
Dclk-mpll.c55 *sdm = DIV_ROUND_CLOSEST_ULL(frac, requested_rate); in params_from_rate()
Dsclk-div.c44 int div = DIV_ROUND_CLOSEST_ULL((u64)prate, rate); in sclk_div_getdiv()
/Linux-v5.4/drivers/clk/sprd/
Dpll.c134 rate = DIV_ROUND_CLOSEST_ULL(refin * kint * k1, in _sprd_pll_recalc_rate()
203 kint = DIV_ROUND_CLOSEST_ULL(tmp, refin * 100); in _sprd_pll_set_rate()
/Linux-v5.4/include/linux/
Dpwm.h205 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle()
234 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle()
/Linux-v5.4/drivers/clk/
Dclk-axi-clkgen.c311 tmp = DIV_ROUND_CLOSEST_ULL(tmp, dout * d); in axi_clkgen_round_rate()
350 tmp = DIV_ROUND_CLOSEST_ULL(tmp, dout * d); in axi_clkgen_recalc_rate()
/Linux-v5.4/drivers/media/dvb-frontends/
Dcxd2820r_c.c67 utmp = 0x4000 - DIV_ROUND_CLOSEST_ULL((u64)if_frequency * 0x4000, CXD2820R_CLK); in cxd2820r_set_frontend_c()

123