Lines Matching full:duty
135 /* Helper function to set the duty cycle ratio to duty/4096 (e.g. duty=2048 -> 50%) */
136 static void pca9685_pwm_set_duty(struct pwm_chip *chip, int channel, unsigned int duty) in pca9685_pwm_set_duty() argument
141 if (duty == 0) { in pca9685_pwm_set_duty()
145 } else if (duty >= PCA9685_COUNTER_RANGE) { in pca9685_pwm_set_duty()
159 * configured duty cycle / power output. in pca9685_pwm_set_duty()
165 off = (on + duty) % PCA9685_COUNTER_RANGE; in pca9685_pwm_set_duty()
202 /* Read ON register to calculate duty cycle of staggered output */ in pca9685_pwm_get_duty()
372 unsigned long long duty, prescale; in __pca9685_pwm_apply() local
414 duty = PCA9685_COUNTER_RANGE * state->duty_cycle; in __pca9685_pwm_apply()
415 duty = DIV_ROUND_UP_ULL(duty, state->period); in __pca9685_pwm_apply()
416 pca9685_pwm_set_duty(chip, pwm->hwpwm, duty); in __pca9685_pwm_apply()
442 unsigned long long duty; in pca9685_pwm_get_state() local
469 duty = pca9685_pwm_get_duty(chip, pwm->hwpwm); in pca9685_pwm_get_state()
470 state->duty_cycle = DIV_ROUND_DOWN_ULL(duty * state->period, PCA9685_COUNTER_RANGE); in pca9685_pwm_get_state()