Lines Matching full:duty
19 * To compensate, this driver always **inverts** the duty value when reading
25 * - When changing both duty cycle and period, we cannot prevent in
27 * settings (new period length and old duty cycle).
28 * - The hardware cannot generate a 0% duty cycle.
130 u32 duty, val, inactive; in pwm_sifive_get_state() local
134 * PWM hardware uses 'inactive' counts in pwmcmp, so invert to get actual duty. in pwm_sifive_get_state()
135 * Here, 'inactive' is the low time and we compute duty as max_count - inactive. in pwm_sifive_get_state()
137 duty = (1U << PWM_SIFIVE_CMPWIDTH) - 1 - inactive; in pwm_sifive_get_state()
139 state->enabled = duty > 0; in pwm_sifive_get_state()
146 state->duty_cycle = DIV_ROUND_UP_ULL((u64)duty * ddata->real_period, in pwm_sifive_get_state()
184 /* The hardware cannot generate a 0% duty cycle */ in pwm_sifive_apply()
186 /* pwmcmp register must be loaded with the inactive(invert the duty) */ in pwm_sifive_apply()