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