Lines Matching refs: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);
162 struct pwm_state *state)
170 state->enabled = !!FIELD_GET(STM32_LPTIM_ENABLE, val);
171 /* Keep PWM counter clock refcount in sync with PWM initial state */
172 if (state->enabled)
177 state->polarity = FIELD_GET(STM32_LPTIM_WAVPOL, val);
182 state->period = DIV_ROUND_CLOSEST_ULL(tmp, rate);
187 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate);
234 struct pwm_state state;
236 pwm_get_state(&priv->chip.pwms[0], &state);
237 if (state.enabled) {