STRUCT PWM_OPS(9)
β¨ NAME β¨
Kernel API Manual, page struct pwm_ops(9) β welcome to the group chat, bestie! π«Ά
struct pwm_ops β PWM controller operations. That's the whole NAME vibe, and honestly? Iconic. π
π¦ SYNOPSIS π¦
Okay so here's the struct, and I need you to keep every single signature exactly as written β no renaming, no merging, no βcreativeβ edits, fr fr:
struct pwm_ops {
int (*request)(struct pwm_chip *chip, struct pwm_device *pwm);
void (*free)(struct pwm_chip *chip, struct pwm_device *pwm);
int (*capture)(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_capture *result, unsigned long timeout);
size_t sizeof_wfhw;
int (*round_waveform_tohw)(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_waveform *wf, void *wfhw);
int (*round_waveform_fromhw)(struct pwm_chip *chip, struct pwm_device *pwm, const void *wfhw, struct pwm_waveform *wf);
int (*read_waveform)(struct pwm_chip *chip, struct pwm_device *pwm, void *wfhw);
int (*write_waveform)(struct pwm_chip *chip, struct pwm_device *pwm, const void *wfhw);
int (*apply)(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state);
int (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state);
};
π Members π
requestβ optional hook for requesting a PWM. β¨freeβ optional hook for freeing a PWM. π¦captureβ capture and report PWM signal. πsizeof_wfhwβ size (in bytes) of driver specific waveform presentation. πround_waveform_tohwβ convert astruct pwm_waveformto driver specific presentation. πΈround_waveform_fromhwβ convert a driver specific waveform presentation tostruct pwm_waveform. πread_waveformβ read driver specific waveform presentation from hardware. π₯write_waveformβ write driver specific waveform presentation to hardware. βapplyβ atomically apply a new PWM config. πget_stateβ get the current PWM state. π
π SEE ALSO π
Kernel file: ./include/linux/pwm.h
enum pwm_polarity(9)struct pwm_args(9)struct pwm_waveform(9)struct pwm_device(9)pwm_get_state(9)pwm_init_state(9)pwm_get_relative_duty_cycle(9)pwm_set_relative_duty_cycle(9)struct pwm_capture(9)struct pwm_chip(9)pwmchip_supports_waveform(9)pwm_config(9)pwm_enable(9)pwm_disable(9)pwm_might_sleep(9)
π«Ά and that's the whole page, bestie β go forth and keep those ops exactly as listed. Source/version:./include/linuxΒ· date:October 2026Β· manual page:struct pwm_ops(9)πΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms