Lines Matching defs:state
114 struct pwm_state *state)
132 state->period = DIV_ROUND_UP_ULL(NSEC_PER_SEC, clk_rate);
133 state->duty_cycle = DIV_ROUND_UP_ULL(state->period, 2);
134 state->polarity = PWM_POLARITY_NORMAL;
135 state->enabled = true;
149 state->polarity = PWM_POLARITY_NORMAL;
151 state->polarity = PWM_POLARITY_INVERSED;
155 state->enabled = true;
157 state->enabled = false;
162 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate);
165 state->period = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate);
169 const struct pwm_state *state,
179 state->enabled &&
180 (state->period * clk_rate >= NSEC_PER_SEC) &&
181 (state->period * clk_rate < 2 * NSEC_PER_SEC) &&
182 (state->duty_cycle * clk_rate * 2 >= NSEC_PER_SEC);
196 div = clk_rate * state->period + NSEC_PER_SEC / 2;
212 div = div * state->period;
223 div *= state->duty_cycle;
224 do_div(div, state->period);
232 const struct pwm_state *state)
252 ret = sun4i_pwm_calculate(sun4i_pwm, state, &duty, &period, &prescaler,
290 if (state->polarity != PWM_POLARITY_NORMAL)
297 if (state->enabled)
304 if (state->enabled)