Home
last modified time | relevance | path

Searched refs:PWM_SIFIVE_CMPWIDTH (Results 1 - 2 of 2) sorted by relevance

/kernel/linux/linux-5.10/drivers/pwm/
H A Dpwm-sifive.c39 #define PWM_SIFIVE_CMPWIDTH 16 macro
91 * lasts (1 << (PWM_SIFIVE_CMPWIDTH + pwmscale)) clock ticks. in pwm_sifive_update_clock()
92 * (1 << (PWM_SIFIVE_CMPWIDTH + scale)) * 10^9/rate = period in pwm_sifive_update_clock()
95 scale = clamp(ilog2(scale_pow) - PWM_SIFIVE_CMPWIDTH, 0, 0xf); in pwm_sifive_update_clock()
102 num = (unsigned long long)NSEC_PER_SEC << (PWM_SIFIVE_CMPWIDTH + scale); in pwm_sifive_update_clock()
124 (u64)duty * ddata->real_period >> PWM_SIFIVE_CMPWIDTH; in pwm_sifive_get_state()
180 num = (u64)duty_cycle * (1U << PWM_SIFIVE_CMPWIDTH); in pwm_sifive_apply()
183 frac = min(frac, (1U << PWM_SIFIVE_CMPWIDTH) - 1); in pwm_sifive_apply()
/kernel/linux/linux-6.6/drivers/pwm/
H A Dpwm-sifive.c40 #define PWM_SIFIVE_CMPWIDTH 16 macro
92 * lasts (1 << (PWM_SIFIVE_CMPWIDTH + pwmscale)) clock ticks. in pwm_sifive_update_clock()
93 * (1 << (PWM_SIFIVE_CMPWIDTH + scale)) * 10^9/rate = period in pwm_sifive_update_clock()
96 scale = clamp(ilog2(scale_pow) - PWM_SIFIVE_CMPWIDTH, 0, 0xf); in pwm_sifive_update_clock()
103 num = (unsigned long long)NSEC_PER_SEC << (PWM_SIFIVE_CMPWIDTH + scale); in pwm_sifive_update_clock()
125 (u64)duty * ddata->real_period >> PWM_SIFIVE_CMPWIDTH; in pwm_sifive_get_state()
158 num = (u64)duty_cycle * (1U << PWM_SIFIVE_CMPWIDTH); in pwm_sifive_apply()
161 frac = min(frac, (1U << PWM_SIFIVE_CMPWIDTH) - 1); in pwm_sifive_apply()

Completed in 2 milliseconds