Lines Matching full:duty
134 /* Helper function to set the duty cycle ratio to duty/4096 (e.g. duty=2048 -> 50%) */
135 static void pca9685_pwm_set_duty(struct pca9685 *pca, int channel, unsigned int duty) in pca9685_pwm_set_duty() argument
140 if (duty == 0) { in pca9685_pwm_set_duty()
144 } else if (duty >= PCA9685_COUNTER_RANGE) { in pca9685_pwm_set_duty()
158 * configured duty cycle / power output. in pca9685_pwm_set_duty()
164 off = (on + duty) % PCA9685_COUNTER_RANGE; in pca9685_pwm_set_duty()
201 /* Read ON register to calculate duty cycle of staggered output */ in pca9685_pwm_get_duty()
367 unsigned long long duty, prescale; in __pca9685_pwm_apply() local
409 duty = PCA9685_COUNTER_RANGE * state->duty_cycle; in __pca9685_pwm_apply()
410 duty = DIV_ROUND_UP_ULL(duty, state->period); in __pca9685_pwm_apply()
411 pca9685_pwm_set_duty(pca, pwm->hwpwm, duty); in __pca9685_pwm_apply()
438 unsigned long long duty; in pca9685_pwm_get_state() local
465 duty = pca9685_pwm_get_duty(pca, pwm->hwpwm); in pca9685_pwm_get_state()
466 state->duty_cycle = DIV_ROUND_DOWN_ULL(duty * state->period, PCA9685_COUNTER_RANGE); in pca9685_pwm_get_state()