diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-03-30 16:57:15 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-31 09:48:34 +0200 |
commit | c5e8deaeebd5e223fc77df6aa8daa25f5b7f3ea9 (patch) | |
tree | 46256819e94257f98eb724921f093cca7df81042 /include | |
parent | 83affc1a6c5e13349d7ea34bd787568aa1c872ff (diff) | |
download | barebox-c5e8deaeebd5e223fc77df6aa8daa25f5b7f3ea9.tar.gz barebox-c5e8deaeebd5e223fc77df6aa8daa25f5b7f3ea9.tar.xz |
PWM: core: add apply API support for polarity
Some PWM chips support outputting an inverted PWM signal.
Add API support for this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/pwm.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/pwm.h b/include/pwm.h index 67ea0f9bcb..b67ab13d2e 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -2,18 +2,24 @@ #ifndef __PWM_H #define __PWM_H +#include <dt-bindings/pwm/pwm.h> + struct pwm_device; struct device_d; +#define PWM_POLARITY_NORMAL 0 + /* * struct pwm_state - state of a PWM channel * @period_ns: PWM period (in nanoseconds) * @duty_ns: PWM duty cycle (in nanoseconds) + * @polarity: PWM polarity * @p_enable: PWM enabled status */ struct pwm_state { unsigned int period_ns; unsigned int duty_ns; + unsigned int polarity; unsigned int p_enable; }; |