Lines Matching full:prescale
75 u32 value, prescale; in iproc_pwmc_get_state() local
97 prescale = value >> IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_get_state()
98 prescale &= IPROC_PWM_PRESCALE_MAX; in iproc_pwmc_get_state()
100 multi = NSEC_PER_SEC * (prescale + 1); in iproc_pwmc_get_state()
116 unsigned long prescale = IPROC_PWM_PRESCALE_MIN; in iproc_pwmc_apply() local
124 * Find period count, duty count and prescale to suit duty_cycle and in iproc_pwmc_apply()
127 * period_ns = 10^9 * (PRESCALE + 1) * PC / PWM_CLK_RATE in iproc_pwmc_apply()
128 * duty_ns = 10^9 * (PRESCALE + 1) * DC / PWM_CLK_RATE in iproc_pwmc_apply()
130 * PC = (PWM_CLK_RATE * period_ns) / (10^9 * (PRESCALE + 1)) in iproc_pwmc_apply()
131 * DC = (PWM_CLK_RATE * duty_ns) / (10^9 * (PRESCALE + 1)) in iproc_pwmc_apply()
136 div = NSEC_PER_SEC * (prescale + 1); in iproc_pwmc_apply()
149 /* Otherwise, increase prescale and recalculate counts */ in iproc_pwmc_apply()
150 if (++prescale > IPROC_PWM_PRESCALE_MAX) in iproc_pwmc_apply()
156 /* Set prescale */ in iproc_pwmc_apply()
159 value |= prescale << IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_apply()