Home
last modified time | relevance | path

Searched refs:duty_steps (Results 1 – 2 of 2) sorted by relevance

/openbmc/linux/drivers/pwm/
H A Dpwm-microchip-core.c137 u64 duty_steps, tmp; in mchp_core_pwm_calc_duty() local
146 duty_steps = mul_u64_u64_div_u64(state->duty_cycle, clk_rate, tmp); in mchp_core_pwm_calc_duty()
148 return duty_steps; in mchp_core_pwm_calc_duty()
152 const struct pwm_state *state, u64 duty_steps, in mchp_core_pwm_apply_duty() argument
157 u8 first_edge = 0, second_edge = duty_steps; in mchp_core_pwm_apply_duty()
165 if (duty_steps == 0) in mchp_core_pwm_apply_duty()
280 u64 duty_steps; in mchp_core_pwm_apply_locked() local
338 duty_steps = mchp_core_pwm_calc_duty(state, clk_rate, prescale, period_steps); in mchp_core_pwm_apply_locked()
345 if (duty_steps > period_steps) in mchp_core_pwm_apply_locked()
346 duty_steps = period_steps + 1; in mchp_core_pwm_apply_locked()
[all …]
H A Dpwm-ab8500.c42 unsigned int duty_steps, div; in ab8500_pwm_apply() local
85 duty_steps = max_t(u64, mul_u64_u64_div_u64(state->duty_cycle, in ab8500_pwm_apply()
94 if (!state->enabled || duty_steps == 0) { in ab8500_pwm_apply()
109 lower_val = (duty_steps - 1) & 0x00ff; in ab8500_pwm_apply()
114 higher_val = ((duty_steps - 1) & 0x0300) >> 8 | (32 - div) << 4; in ab8500_pwm_apply()
145 unsigned int div, duty_steps; in ab8500_pwm_get_state() local
173 duty_steps = ((higher_val & 3) << 8 | lower_val) + 1; in ab8500_pwm_get_state()
176 state->duty_cycle = DIV64_U64_ROUND_UP((u64)div * duty_steps, AB8500_PWM_CLKRATE); in ab8500_pwm_get_state()