Lines Matching defs:state
35 const struct pwm_state *state)
47 if (!state->enabled) {
60 div = (unsigned long long)clk_get_rate(priv->clk) * state->period;
64 dev_dbg(priv->chip.dev, "Can't reach %llu ns\n", state->period);
80 dty = prd * state->duty_cycle;
81 do_div(dty, state->period);
95 (FIELD_GET(STM32_LPTIM_WAVPOL, cfgr) != state->polarity)) {
97 val |= FIELD_PREP(STM32_LPTIM_WAVPOL, state->polarity);
161 struct pwm_state *state)
169 state->enabled = !!FIELD_GET(STM32_LPTIM_ENABLE, val);
170 /* Keep PWM counter clock refcount in sync with PWM initial state */
171 if (state->enabled)
176 state->polarity = FIELD_GET(STM32_LPTIM_WAVPOL, val);
181 state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate);
186 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate);
225 struct pwm_state state;
227 pwm_get_state(&priv->chip.pwms[0], &state);
228 if (state.enabled) {