• Home
  • Raw
  • Download

Lines Matching refs:state

89 	struct pwm_state state;  member
106 struct pwm_state *state) in pwm_get_state() argument
108 *state = pwm->state; in pwm_get_state()
113 struct pwm_state state; in pwm_is_enabled() local
115 pwm_get_state(pwm, &state); in pwm_is_enabled()
117 return state.enabled; in pwm_is_enabled()
122 struct pwm_state state; in pwm_get_period() local
124 pwm_get_state(pwm, &state); in pwm_get_period()
126 return state.period; in pwm_get_period()
131 struct pwm_state state; in pwm_get_duty_cycle() local
133 pwm_get_state(pwm, &state); in pwm_get_duty_cycle()
135 return state.duty_cycle; in pwm_get_duty_cycle()
140 struct pwm_state state; in pwm_get_polarity() local
142 pwm_get_state(pwm, &state); in pwm_get_polarity()
144 return state.polarity; in pwm_get_polarity()
171 struct pwm_state *state) in pwm_init_state() argument
176 pwm_get_state(pwm, state); in pwm_init_state()
181 state->period = args.period; in pwm_init_state()
182 state->polarity = args.polarity; in pwm_init_state()
183 state->duty_cycle = 0; in pwm_init_state()
184 state->usage_power = false; in pwm_init_state()
201 pwm_get_relative_duty_cycle(const struct pwm_state *state, unsigned int scale) in pwm_get_relative_duty_cycle() argument
203 if (!state->period) in pwm_get_relative_duty_cycle()
206 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle()
207 state->period); in pwm_get_relative_duty_cycle()
229 pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, in pwm_set_relative_duty_cycle() argument
235 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle()
236 state->period, in pwm_set_relative_duty_cycle()
266 const struct pwm_state *state);
268 struct pwm_state *state);
318 int pwm_apply_might_sleep(struct pwm_device *pwm, const struct pwm_state *state);
319 int pwm_apply_atomic(struct pwm_device *pwm, const struct pwm_state *state);
333 struct pwm_state state; in pwm_config() local
341 pwm_get_state(pwm, &state); in pwm_config()
342 if (state.duty_cycle == duty_ns && state.period == period_ns) in pwm_config()
345 state.duty_cycle = duty_ns; in pwm_config()
346 state.period = period_ns; in pwm_config()
347 return pwm_apply_might_sleep(pwm, &state); in pwm_config()
358 struct pwm_state state; in pwm_enable() local
363 pwm_get_state(pwm, &state); in pwm_enable()
364 if (state.enabled) in pwm_enable()
367 state.enabled = true; in pwm_enable()
368 return pwm_apply_might_sleep(pwm, &state); in pwm_enable()
377 struct pwm_state state; in pwm_disable() local
382 pwm_get_state(pwm, &state); in pwm_disable()
383 if (!state.enabled) in pwm_disable()
386 state.enabled = false; in pwm_disable()
387 pwm_apply_might_sleep(pwm, &state); in pwm_disable()
432 const struct pwm_state *state) in pwm_apply_might_sleep() argument
439 const struct pwm_state *state) in pwm_apply_atomic() argument
530 struct pwm_state state = { }; in pwm_apply_args() local
553 state.enabled = false; in pwm_apply_args()
554 state.polarity = pwm->args.polarity; in pwm_apply_args()
555 state.period = pwm->args.period; in pwm_apply_args()
556 state.usage_power = false; in pwm_apply_args()
558 pwm_apply_might_sleep(pwm, &state); in pwm_apply_args()