All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: <thierry.reding@gmail.com>, <shc_work@mail.ru>,
	<robh+dt@kernel.org>, <mark.rutland@arm.com>, <corbet@lwn.net>,
	<nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>
Cc: <linux-pwm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [RESEND PATCH v5 5/9] pwm: add PWM modes
Date: Tue, 28 Aug 2018 16:01:22 +0300	[thread overview]
Message-ID: <1535461286-12308-6-git-send-email-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <1535461286-12308-1-git-send-email-claudiu.beznea@microchip.com>

Add PWM normal and complementary modes.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 Documentation/devicetree/bindings/pwm/pwm.txt |  9 +++++++--
 Documentation/pwm.txt                         | 26 +++++++++++++++++++++++---
 include/dt-bindings/pwm/pwm.h                 |  1 +
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm.txt b/Documentation/devicetree/bindings/pwm/pwm.txt
index 8556263b8502..7c8aaac43f92 100644
--- a/Documentation/devicetree/bindings/pwm/pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm.txt
@@ -46,11 +46,16 @@ period in nanoseconds.
 Optionally, the pwm-specifier can encode a number of flags (defined in
 <dt-bindings/pwm/pwm.h>) in a third cell:
 - PWM_POLARITY_INVERTED: invert the PWM signal polarity
+- PWM_MODE_COMPLEMENTARY: PWM complementary working mode (for PWM channels
+with two outputs); if not specified, the default for PWM channel will be
+used
 
-Example with optional PWM specifier for inverse polarity
+Example with optional PWM specifier for inverse polarity and complementary
+mode:
 
 	bl: backlight {
-		pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED>;
+		pwms = <&pwm 0 5000000
+			(PWM_MODE_COMPLEMENTARY | PWM_POLARITY_INVERTED)>;
 		pwm-names = "backlight";
 	};
 
diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt
index 8fbf0aa3ba2d..912c43da8b48 100644
--- a/Documentation/pwm.txt
+++ b/Documentation/pwm.txt
@@ -61,9 +61,9 @@ In addition to the PWM state, the PWM API also exposes PWM arguments, which
 are the reference PWM config one should use on this PWM.
 PWM arguments are usually platform-specific and allows the PWM user to only
 care about dutycycle relatively to the full period (like, duty = 50% of the
-period). struct pwm_args contains 2 fields (period and polarity) and should
-be used to set the initial PWM config (usually done in the probe function
-of the PWM user). PWM arguments are retrieved with pwm_get_args().
+period). struct pwm_args contains 3 fields (period, polarity and mode) and
+should be used to set the initial PWM config (usually done in the probe
+function of the PWM user). PWM arguments are retrieved with pwm_get_args().
 
 Using PWMs with the sysfs interface
 -----------------------------------
@@ -110,6 +110,26 @@ channel that was exported. The following properties will then be available:
 	- 0 - disabled
 	- 1 - enabled
 
+  mode
+    Get/set PWM channel working mode.
+
+    Normal mode - for PWM channels with one output; this should be the
+        default working mode for every PWM channel; output waveforms looks
+        like this:
+             __    __    __    __
+    PWM   __|  |__|  |__|  |__|  |__
+            <--T-->
+
+    Complementary mode - for PWM channels with two outputs; output waveforms
+        looks line this:
+             __    __    __    __
+    PWMH1 __|  |__|  |__|  |__|  |__
+          __    __    __    __    __
+    PWML1   |__|  |__|  |__|  |__|
+            <--T-->
+
+    Where T is the signal period.
+
 Implementing a PWM driver
 -------------------------
 
diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h
index ab9a077e3c7d..b82279cc1787 100644
--- a/include/dt-bindings/pwm/pwm.h
+++ b/include/dt-bindings/pwm/pwm.h
@@ -11,5 +11,6 @@
 #define _DT_BINDINGS_PWM_PWM_H
 
 #define PWM_POLARITY_INVERTED			(1 << 0)
+#define PWM_MODE_COMPLEMENTARY			(1 << 1)
 
 #endif
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: thierry.reding@gmail.com, shc_work@mail.ru, robh+dt@kernel.org,
	mark.rutland@arm.com, corbet@lwn.net,
	nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [RESEND PATCH v5 5/9] pwm: add PWM modes
Date: Tue, 28 Aug 2018 16:01:22 +0300	[thread overview]
Message-ID: <1535461286-12308-6-git-send-email-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <1535461286-12308-1-git-send-email-claudiu.beznea@microchip.com>

Add PWM normal and complementary modes.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 Documentation/devicetree/bindings/pwm/pwm.txt |  9 +++++++--
 Documentation/pwm.txt                         | 26 +++++++++++++++++++++++---
 include/dt-bindings/pwm/pwm.h                 |  1 +
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm.txt b/Documentation/devicetree/bindings/pwm/pwm.txt
index 8556263b8502..7c8aaac43f92 100644
--- a/Documentation/devicetree/bindings/pwm/pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm.txt
@@ -46,11 +46,16 @@ period in nanoseconds.
 Optionally, the pwm-specifier can encode a number of flags (defined in
 <dt-bindings/pwm/pwm.h>) in a third cell:
 - PWM_POLARITY_INVERTED: invert the PWM signal polarity
+- PWM_MODE_COMPLEMENTARY: PWM complementary working mode (for PWM channels
+with two outputs); if not specified, the default for PWM channel will be
+used
 
-Example with optional PWM specifier for inverse polarity
+Example with optional PWM specifier for inverse polarity and complementary
+mode:
 
 	bl: backlight {
-		pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED>;
+		pwms = <&pwm 0 5000000
+			(PWM_MODE_COMPLEMENTARY | PWM_POLARITY_INVERTED)>;
 		pwm-names = "backlight";
 	};
 
diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt
index 8fbf0aa3ba2d..912c43da8b48 100644
--- a/Documentation/pwm.txt
+++ b/Documentation/pwm.txt
@@ -61,9 +61,9 @@ In addition to the PWM state, the PWM API also exposes PWM arguments, which
 are the reference PWM config one should use on this PWM.
 PWM arguments are usually platform-specific and allows the PWM user to only
 care about dutycycle relatively to the full period (like, duty = 50% of the
-period). struct pwm_args contains 2 fields (period and polarity) and should
-be used to set the initial PWM config (usually done in the probe function
-of the PWM user). PWM arguments are retrieved with pwm_get_args().
+period). struct pwm_args contains 3 fields (period, polarity and mode) and
+should be used to set the initial PWM config (usually done in the probe
+function of the PWM user). PWM arguments are retrieved with pwm_get_args().
 
 Using PWMs with the sysfs interface
 -----------------------------------
@@ -110,6 +110,26 @@ channel that was exported. The following properties will then be available:
 	- 0 - disabled
 	- 1 - enabled
 
+  mode
+    Get/set PWM channel working mode.
+
+    Normal mode - for PWM channels with one output; this should be the
+        default working mode for every PWM channel; output waveforms looks
+        like this:
+             __    __    __    __
+    PWM   __|  |__|  |__|  |__|  |__
+            <--T-->
+
+    Complementary mode - for PWM channels with two outputs; output waveforms
+        looks line this:
+             __    __    __    __
+    PWMH1 __|  |__|  |__|  |__|  |__
+          __    __    __    __    __
+    PWML1   |__|  |__|  |__|  |__|
+            <--T-->
+
+    Where T is the signal period.
+
 Implementing a PWM driver
 -------------------------
 
diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h
index ab9a077e3c7d..b82279cc1787 100644
--- a/include/dt-bindings/pwm/pwm.h
+++ b/include/dt-bindings/pwm/pwm.h
@@ -11,5 +11,6 @@
 #define _DT_BINDINGS_PWM_PWM_H
 
 #define PWM_POLARITY_INVERTED			(1 << 0)
+#define PWM_MODE_COMPLEMENTARY			(1 << 1)
 
 #endif
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: claudiu.beznea@microchip.com (Claudiu Beznea)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH v5 5/9] pwm: add PWM modes
Date: Tue, 28 Aug 2018 16:01:22 +0300	[thread overview]
Message-ID: <1535461286-12308-6-git-send-email-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <1535461286-12308-1-git-send-email-claudiu.beznea@microchip.com>

Add PWM normal and complementary modes.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 Documentation/devicetree/bindings/pwm/pwm.txt |  9 +++++++--
 Documentation/pwm.txt                         | 26 +++++++++++++++++++++++---
 include/dt-bindings/pwm/pwm.h                 |  1 +
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm.txt b/Documentation/devicetree/bindings/pwm/pwm.txt
index 8556263b8502..7c8aaac43f92 100644
--- a/Documentation/devicetree/bindings/pwm/pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm.txt
@@ -46,11 +46,16 @@ period in nanoseconds.
 Optionally, the pwm-specifier can encode a number of flags (defined in
 <dt-bindings/pwm/pwm.h>) in a third cell:
 - PWM_POLARITY_INVERTED: invert the PWM signal polarity
+- PWM_MODE_COMPLEMENTARY: PWM complementary working mode (for PWM channels
+with two outputs); if not specified, the default for PWM channel will be
+used
 
-Example with optional PWM specifier for inverse polarity
+Example with optional PWM specifier for inverse polarity and complementary
+mode:
 
 	bl: backlight {
-		pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED>;
+		pwms = <&pwm 0 5000000
+			(PWM_MODE_COMPLEMENTARY | PWM_POLARITY_INVERTED)>;
 		pwm-names = "backlight";
 	};
 
diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt
index 8fbf0aa3ba2d..912c43da8b48 100644
--- a/Documentation/pwm.txt
+++ b/Documentation/pwm.txt
@@ -61,9 +61,9 @@ In addition to the PWM state, the PWM API also exposes PWM arguments, which
 are the reference PWM config one should use on this PWM.
 PWM arguments are usually platform-specific and allows the PWM user to only
 care about dutycycle relatively to the full period (like, duty = 50% of the
-period). struct pwm_args contains 2 fields (period and polarity) and should
-be used to set the initial PWM config (usually done in the probe function
-of the PWM user). PWM arguments are retrieved with pwm_get_args().
+period). struct pwm_args contains 3 fields (period, polarity and mode) and
+should be used to set the initial PWM config (usually done in the probe
+function of the PWM user). PWM arguments are retrieved with pwm_get_args().
 
 Using PWMs with the sysfs interface
 -----------------------------------
@@ -110,6 +110,26 @@ channel that was exported. The following properties will then be available:
 	- 0 - disabled
 	- 1 - enabled
 
+  mode
+    Get/set PWM channel working mode.
+
+    Normal mode - for PWM channels with one output; this should be the
+        default working mode for every PWM channel; output waveforms looks
+        like this:
+             __    __    __    __
+    PWM   __|  |__|  |__|  |__|  |__
+            <--T-->
+
+    Complementary mode - for PWM channels with two outputs; output waveforms
+        looks line this:
+             __    __    __    __
+    PWMH1 __|  |__|  |__|  |__|  |__
+          __    __    __    __    __
+    PWML1   |__|  |__|  |__|  |__|
+            <--T-->
+
+    Where T is the signal period.
+
 Implementing a PWM driver
 -------------------------
 
diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h
index ab9a077e3c7d..b82279cc1787 100644
--- a/include/dt-bindings/pwm/pwm.h
+++ b/include/dt-bindings/pwm/pwm.h
@@ -11,5 +11,6 @@
 #define _DT_BINDINGS_PWM_PWM_H
 
 #define PWM_POLARITY_INVERTED			(1 << 0)
+#define PWM_MODE_COMPLEMENTARY			(1 << 1)
 
 #endif
-- 
2.7.4

  parent reply	other threads:[~2018-08-28 13:02 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 13:01 [RESEND PATCH v5 0/9] extend PWM framework to support PWM modes Claudiu Beznea
2018-08-28 13:01 ` Claudiu Beznea
2018-08-28 13:01 ` Claudiu Beznea
2018-08-28 13:01 ` [RESEND PATCH v5 1/9] pwm: extend PWM framework with " Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-10-16 12:25   ` Thierry Reding
2018-10-16 12:25     ` Thierry Reding
2018-10-17 12:42     ` Claudiu.Beznea
2018-10-17 12:42       ` Claudiu.Beznea at microchip.com
2018-10-17 12:42       ` Claudiu.Beznea
2018-10-18 15:32       ` Thierry Reding
2018-10-18 15:32         ` Thierry Reding
2018-10-19 11:18         ` Claudiu Beznea
2018-10-19 11:18           ` Claudiu Beznea
2018-10-19 11:18           ` Claudiu Beznea
2018-08-28 13:01 ` [RESEND PATCH v5 2/9] pwm: clps711x: populate PWM mode in of_xlate function Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01 ` [RESEND PATCH v5 3/9] pwm: cros-ec: " Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01 ` [RESEND PATCH v5 4/9] pwm: pxa: " Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01 ` Claudiu Beznea [this message]
2018-08-28 13:01   ` [RESEND PATCH v5 5/9] pwm: add PWM modes Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 22:27   ` Rob Herring
2018-08-28 22:27     ` Rob Herring
2018-08-28 13:01 ` [RESEND PATCH v5 6/9] pwm: atmel: add pwm capabilities Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01 ` [RESEND PATCH v5 7/9] pwm: add push-pull mode support Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01 ` [RESEND PATCH v5 8/9] pwm: add documentation for pwm push-pull mode Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-10-12 12:15   ` Thierry Reding
2018-10-12 12:15     ` Thierry Reding
2018-10-12 13:05     ` Claudiu.Beznea
2018-10-12 13:05       ` Claudiu.Beznea at microchip.com
2018-10-12 13:05       ` Claudiu.Beznea
2018-08-28 13:01 ` [RESEND PATCH v5 9/9] pwm: atmel: add push-pull mode support Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-08-28 13:01   ` Claudiu Beznea
2018-09-14 16:20 ` [RESEND PATCH v5 0/9] extend PWM framework to support PWM modes Nicolas Ferre
2018-09-14 16:20   ` Nicolas Ferre
2018-09-14 16:20   ` Nicolas Ferre
2018-10-03 12:49   ` Nicolas Ferre
2018-10-03 12:49     ` Nicolas Ferre
2018-10-03 12:49     ` Nicolas Ferre
2018-10-16 12:03   ` Thierry Reding
2018-10-16 12:03     ` Thierry Reding
2018-10-17 12:41     ` Claudiu.Beznea
2018-10-17 12:41       ` Claudiu.Beznea at microchip.com
2018-10-17 12:41       ` Claudiu.Beznea
2018-10-18 16:00       ` Thierry Reding
2018-10-18 16:00         ` Thierry Reding
2018-10-19 11:18         ` Claudiu Beznea
2018-10-19 11:18           ` Claudiu Beznea
2018-10-19 11:18           ` Claudiu Beznea
2018-10-22  8:29 ` Uwe Kleine-König
2018-10-22  8:29   ` Uwe Kleine-König
2018-10-26 10:44   ` Claudiu.Beznea
2018-10-26 10:44     ` Claudiu.Beznea at microchip.com
2018-10-26 10:44     ` Claudiu.Beznea
2018-10-26 12:56     ` Uwe Kleine-König
2018-10-26 12:56       ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1535461286-12308-6-git-send-email-claudiu.beznea@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh+dt@kernel.org \
    --cc=shc_work@mail.ru \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.