7 * pwm_request - request a PWM device
9 struct pwm_device *pwm_request(int pwm_id, const char *label);
12 * pwm_free - free a PWM device
14 void pwm_free(struct pwm_device *pwm);
17 * pwm_config - change a PWM device configuration
19 int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);
22 * pwm_enable - start a PWM output toggling
24 int pwm_enable(struct pwm_device *pwm);
27 * pwm_disable - stop a PWM output toggling
29 void pwm_disable(struct pwm_device *pwm);
35 * struct pwm_ops - PWM controller operations
36 * @request: optional hook for requesting a PWM
37 * @free: optional hook for freeing a PWM
38 * @config: configure duty cycles and period length for this PWM
39 * @enable: enable PWM output toggling
40 * @disable: disable PWM output toggling
41 * @owner: helps prevent removal of modules exporting active PWMs
44 int (*request)(struct pwm_chip *chip);
45 void (*free)(struct pwm_chip *chip);
46 int (*config)(struct pwm_chip *chip, int duty_ns,
48 int (*enable)(struct pwm_chip *chip);
49 void (*disable)(struct pwm_chip *chip);
54 * struct pwm_chip - abstract a PWM
55 * @pwm_id: global PWM device index
56 * @label: PWM device label
57 * @ops: controller operations
65 int pwmchip_add(struct pwm_chip *chip);
66 int pwmchip_remove(struct pwm_chip *chip);
69 #endif /* __LINUX_PWM_H */