Lines Matching full:period
21 #define PERIOD(x) (((x) * 0x10) + 0x10) macro
71 * period_cycles must be a 32 bit value, so period * rate / NSEC_PER_SEC in bcm2835_pwm_apply()
73 * multiplication period * rate doesn't overflow. in bcm2835_pwm_apply()
74 * To calculate the maximal possible period that guarantees the in bcm2835_pwm_apply()
77 * round(period * rate / NSEC_PER_SEC) <= U32_MAX in bcm2835_pwm_apply()
78 * <=> period * rate / NSEC_PER_SEC < U32_MAX + 0.5 in bcm2835_pwm_apply()
79 * <=> period * rate < (U32_MAX + 0.5) * NSEC_PER_SEC in bcm2835_pwm_apply()
80 * <=> period < ((U32_MAX + 0.5) * NSEC_PER_SEC) / rate in bcm2835_pwm_apply()
81 * <=> period < ((U32_MAX * NSEC_PER_SEC + NSEC_PER_SEC/2) / rate in bcm2835_pwm_apply()
82 * <=> period <= ceil((U32_MAX * NSEC_PER_SEC + NSEC_PER_SEC/2) / rate) - 1 in bcm2835_pwm_apply()
86 if (state->period > max_period) in bcm2835_pwm_apply()
89 /* set period */ in bcm2835_pwm_apply()
90 period_cycles = DIV_ROUND_CLOSEST_ULL(state->period * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply()
92 /* don't accept a period that is too small */ in bcm2835_pwm_apply()
96 writel(period_cycles, pc->base + PERIOD(pwm->hwpwm)); in bcm2835_pwm_apply()