[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1546522081-23659-5-git-send-email-claudiu.beznea@microchip.com>
Date: Thu, 3 Jan 2019 13:29:53 +0000
From: <Claudiu.Beznea@...rochip.com>
To: <thierry.reding@...il.com>, <corbet@....net>,
<Nicolas.Ferre@...rochip.com>, <alexandre.belloni@...tlin.com>,
<Ludovic.Desroches@...rochip.com>
CC: <linux-pwm@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<Claudiu.Beznea@...rochip.com>
Subject: [PATCH v8 4/6] pwm: add push-pull mode support
From: Claudiu Beznea <claudiu.beznea@...rochip.com>
Add push-pull mode support. In push-pull mode the channels' outputs have
same polarities and the edges are complementary delayed for one period.
Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
---
drivers/pwm/core.c | 3 +++
include/linux/pwm.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index eb444ee8d486..f182d1eb564e 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -328,6 +328,9 @@ const char *pwm_get_mode_name(unsigned long modebit)
if (modebit == PWM_MODE_BIT(COMPLEMENTARY))
return "complementary";
+ if (modebit == PWM_MODE_BIT(PUSH_PULL))
+ return "push-pull";
+
return "normal";
}
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 3d89343bc405..629754902ab0 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -29,11 +29,14 @@ enum pwm_polarity {
* PWM modes capabilities
* @PWM_MODE_NORMAL: PWM has one output
* @PWM_MODE_COMPLEMENTARY: PWM has 2 outputs with opposite polarities
+ * @PWM_MODE_PUSH_PULL: PWM has 2 outputs with same polarities and the edges
+ * are complementary delayed for one period
* @PWM_MODE_CNT: PWM modes count
*/
enum pwm_mode {
PWM_MODE_NORMAL,
PWM_MODE_COMPLEMENTARY,
+ PWM_MODE_PUSH_PULL,
PWM_MODE_CNT,
};
--
2.7.4
Powered by blists - more mailing lists