From c5e8deaeebd5e223fc77df6aa8daa25f5b7f3ea9 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 30 Mar 2020 16:57:15 +0200 Subject: 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 Signed-off-by: Sascha Hauer --- include/pwm.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') 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 + 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; }; -- cgit v1.2.3