Lines Matching refs:pwm
87 unsigned int pwm; member
108 static inline void pwm_get_state(const struct pwm_device *pwm, in pwm_get_state() argument
111 *state = pwm->state; in pwm_get_state()
114 static inline bool pwm_is_enabled(const struct pwm_device *pwm) in pwm_is_enabled() argument
118 pwm_get_state(pwm, &state); in pwm_is_enabled()
123 static inline void pwm_set_period(struct pwm_device *pwm, u64 period) in pwm_set_period() argument
125 if (pwm) in pwm_set_period()
126 pwm->state.period = period; in pwm_set_period()
129 static inline u64 pwm_get_period(const struct pwm_device *pwm) in pwm_get_period() argument
133 pwm_get_state(pwm, &state); in pwm_get_period()
138 static inline void pwm_set_duty_cycle(struct pwm_device *pwm, unsigned int duty) in pwm_set_duty_cycle() argument
140 if (pwm) in pwm_set_duty_cycle()
141 pwm->state.duty_cycle = duty; in pwm_set_duty_cycle()
144 static inline u64 pwm_get_duty_cycle(const struct pwm_device *pwm) in pwm_get_duty_cycle() argument
148 pwm_get_state(pwm, &state); in pwm_get_duty_cycle()
153 static inline enum pwm_polarity pwm_get_polarity(const struct pwm_device *pwm) in pwm_get_polarity() argument
157 pwm_get_state(pwm, &state); in pwm_get_polarity()
162 static inline void pwm_get_args(const struct pwm_device *pwm, in pwm_get_args() argument
165 *args = pwm->args; in pwm_get_args()
185 static inline void pwm_init_state(const struct pwm_device *pwm, in pwm_init_state() argument
191 pwm_get_state(pwm, state); in pwm_init_state()
194 pwm_get_args(pwm, &args); in pwm_init_state()
273 int (*request)(struct pwm_chip *chip, struct pwm_device *pwm);
274 void (*free)(struct pwm_chip *chip, struct pwm_device *pwm);
275 int (*capture)(struct pwm_chip *chip, struct pwm_device *pwm,
277 int (*apply)(struct pwm_chip *chip, struct pwm_device *pwm,
279 void (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,
284 int (*config)(struct pwm_chip *chip, struct pwm_device *pwm,
286 int (*set_polarity)(struct pwm_chip *chip, struct pwm_device *pwm,
288 int (*enable)(struct pwm_chip *chip, struct pwm_device *pwm);
289 void (*disable)(struct pwm_chip *chip, struct pwm_device *pwm);
335 void pwm_free(struct pwm_device *pwm);
336 int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state);
337 int pwm_adjust_config(struct pwm_device *pwm);
347 static inline int pwm_config(struct pwm_device *pwm, int duty_ns, in pwm_config() argument
352 if (!pwm) in pwm_config()
358 pwm_get_state(pwm, &state); in pwm_config()
364 return pwm_apply_state(pwm, &state); in pwm_config()
373 static inline int pwm_enable(struct pwm_device *pwm) in pwm_enable() argument
377 if (!pwm) in pwm_enable()
380 pwm_get_state(pwm, &state); in pwm_enable()
385 return pwm_apply_state(pwm, &state); in pwm_enable()
392 static inline void pwm_disable(struct pwm_device *pwm) in pwm_disable() argument
396 if (!pwm) in pwm_disable()
399 pwm_get_state(pwm, &state); in pwm_disable()
404 pwm_apply_state(pwm, &state); in pwm_disable()
408 int pwm_capture(struct pwm_device *pwm, struct pwm_capture *result,
410 int pwm_set_chip_data(struct pwm_device *pwm, void *data);
411 void *pwm_get_chip_data(struct pwm_device *pwm);
428 void pwm_put(struct pwm_device *pwm);
442 static inline void pwm_free(struct pwm_device *pwm) in pwm_free() argument
446 static inline int pwm_apply_state(struct pwm_device *pwm, in pwm_apply_state() argument
452 static inline int pwm_adjust_config(struct pwm_device *pwm) in pwm_adjust_config() argument
457 static inline int pwm_config(struct pwm_device *pwm, int duty_ns, in pwm_config() argument
463 static inline int pwm_capture(struct pwm_device *pwm, in pwm_capture() argument
470 static inline int pwm_enable(struct pwm_device *pwm) in pwm_enable() argument
475 static inline void pwm_disable(struct pwm_device *pwm) in pwm_disable() argument
479 static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data) in pwm_set_chip_data() argument
484 static inline void *pwm_get_chip_data(struct pwm_device *pwm) in pwm_get_chip_data() argument
524 static inline void pwm_put(struct pwm_device *pwm) in pwm_put() argument
549 static inline void pwm_apply_args(struct pwm_device *pwm) in pwm_apply_args() argument
575 state.polarity = pwm->args.polarity; in pwm_apply_args()
576 state.period = pwm->args.period; in pwm_apply_args()
579 pwm_apply_state(pwm, &state); in pwm_apply_args()