summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-04-15 07:35:58 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2024-04-16 12:10:05 +0200
commit32a64b0e2cf7fbb25f7cbb98a4f6df4fe277369a (patch)
treef09b4c8662fba9c6e607ac240a83c89ba73d5481 /include
parentc5ae8eb5ef72385556c0665cf9fe0247219d83f6 (diff)
downloadbarebox-32a64b0e2cf7fbb25f7cbb98a4f6df4fe277369a.tar.gz
barebox-32a64b0e2cf7fbb25f7cbb98a4f6df4fe277369a.tar.xz
PWM: core: add definition for PWM_POLARITY_INVERSED
PWM_POLARITY_INVERTED is the macro used in the DT binding, while PWM_POLARITY_INVERSED is the Linux driver macro that it is translated to. They are the same value, but Linux PWM chip drivers will use the latter, so define it as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240415053600.370622-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/pwm.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/pwm.h b/include/pwm.h
index e8b0f2c962..b90ac1de42 100644
--- a/include/pwm.h
+++ b/include/pwm.h
@@ -8,7 +8,19 @@
struct pwm_device;
struct device;
-#define PWM_POLARITY_NORMAL 0
+/**
+ * enum pwm_polarity - polarity of a PWM signal
+ * @PWM_POLARITY_NORMAL: a high signal for the duration of the duty-
+ * cycle, followed by a low signal for the remainder of the pulse
+ * period
+ * @PWM_POLARITY_INVERSED: a low signal for the duration of the duty-
+ * cycle, followed by a high signal for the remainder of the pulse
+ * period
+ */
+enum pwm_polarity {
+ PWM_POLARITY_NORMAL,
+ PWM_POLARITY_INVERSED,
+};
/*
* struct pwm_state - state of a PWM channel