Lines Matching defs:state
55 const struct pwm_state *state)
61 if (state->period > PWM_MAX_PERIOD_NS) {
66 if (state->polarity != PWM_POLARITY_NORMAL)
69 if (pwm_is_enabled(pwm) && !state->enabled) {
77 if (pwm_get_duty_cycle(pwm) != state->duty_cycle ||
78 pwm_get_period(pwm) != state->period) {
79 u64 level = state->duty_cycle * PWM_MAX_LEVEL;
81 do_div(level, state->period);
90 if (pwm_is_enabled(pwm) && state->enabled &&
91 pwm_get_period(pwm) != state->period) {
100 if (pwm_get_period(pwm) != state->period ||
101 pwm_is_enabled(pwm) != state->enabled) {
102 int clk_div = crc_pwm_calc_clk_div(state->period);
103 int pwm_output_enable = state->enabled ? PWM_OUTPUT_ENABLE : 0;
113 if (!pwm_is_enabled(pwm) && state->enabled) {
125 struct pwm_state *state)
146 state->period =
148 state->duty_cycle =
149 DIV_ROUND_UP_ULL(duty_cycle_reg * state->period, PWM_MAX_LEVEL);
150 state->polarity = PWM_POLARITY_NORMAL;
151 state->enabled = !!(clk_div_reg & PWM_OUTPUT_ENABLE);