devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add PWM polarity flag macro for DT
@ 2013-07-17 22:54 Laurent Pinchart
  2013-07-17 22:54 ` [PATCH v2 1/4] pwm: " Laurent Pinchart
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Laurent Pinchart @ 2013-07-17 22:54 UTC (permalink / raw)
  To: Thierry Reding
  Cc: linux-pwm-u79uwXL29TY76Z2rM5mHXA, Boris BREZILLON,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Steffen Trumtrar,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hello,

Here's a small patch set that replaces PWM polarity numerical constants with
macros in DT.

The series is the result of splitting the original patch into four patches
that

- add the flag macro (both in a header file and in the PWM DT binding core
  documentation)
- use the macro in the PWM core code
- update existing DT bindings to refer to the PWM DT bindings core
  documentation
- update existing DT sources to use the new macro

I believe I've taken all comments received so far into account. Most notable
changes include

- splitting the original patch
- removing the PWM_POLARITY_NORMAL flag, which wasn't a flag but was defined
  as 0
- renaming the PWM_POLARITY_INVERSED DT flag to PWM_POLARITY_INVERTED
- not relying on DT flags and PWM C flags having identical names and values

Laurent Pinchart (4):
  pwm: Add PWM polarity flag macro for DT
  pwm: Use the DT macro directly when parsing PWM DT flags
  pwm: Update DT bindings to reference pwm.txt for cells documentation
  ARM: dts: Use the PWM polarity flags

 Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt    |  8 +++-----
 Documentation/devicetree/bindings/pwm/imx-pwm.txt          |  4 ++--
 Documentation/devicetree/bindings/pwm/mxs-pwm.txt          |  4 ++--
 .../devicetree/bindings/pwm/nvidia,tegra20-pwm.txt         |  5 ++---
 Documentation/devicetree/bindings/pwm/nxp,pca9685-pwm.txt  |  4 ++--
 Documentation/devicetree/bindings/pwm/pwm-samsung.txt      | 10 +++-------
 Documentation/devicetree/bindings/pwm/pwm-tiecap.txt       |  8 +++-----
 Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt     |  8 +++-----
 Documentation/devicetree/bindings/pwm/pwm.txt              |  7 ++++---
 Documentation/devicetree/bindings/pwm/spear-pwm.txt        |  5 ++---
 Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt       |  4 ++--
 Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt    |  4 ++--
 Documentation/devicetree/bindings/pwm/vt8500-pwm.txt       |  8 +++-----
 arch/arm/boot/dts/am335x-evmsk.dts                         |  3 ++-
 arch/arm/boot/dts/wm8850-w70v2.dts                         |  3 ++-
 drivers/pwm/core.c                                         |  7 +++----
 include/dt-bindings/pwm/pwm.h                              | 14 ++++++++++++++
 17 files changed, 54 insertions(+), 52 deletions(-)
 create mode 100644 include/dt-bindings/pwm/pwm.h

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/4] pwm: Add PWM polarity flag macro for DT
  2013-07-17 22:54 [PATCH v2 0/4] Add PWM polarity flag macro for DT Laurent Pinchart
@ 2013-07-17 22:54 ` Laurent Pinchart
  2013-07-17 22:54 ` [PATCH v2 2/4] pwm: Use the DT macro directly when parsing PWM DT flags Laurent Pinchart
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2013-07-17 22:54 UTC (permalink / raw)
  To: Thierry Reding
  Cc: devicetree-discuss, linux-omap, linux-pwm, linux-arm-kernel,
	Boris BREZILLON, Shawn Guo, Steffen Trumtrar, Stephen Warren,
	Tomasz Figa

Define a PWM_POLARITY_INVERTED macro in include/dt-bindings/pwm/pwm.h to
be used by device tree sources.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 Documentation/devicetree/bindings/pwm/pwm.txt |  7 ++++---
 include/dt-bindings/pwm/pwm.h                 | 14 ++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)
 create mode 100644 include/dt-bindings/pwm/pwm.h

diff --git a/Documentation/devicetree/bindings/pwm/pwm.txt b/Documentation/devicetree/bindings/pwm/pwm.txt
index 06e6724..8556263 100644
--- a/Documentation/devicetree/bindings/pwm/pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm.txt
@@ -43,13 +43,14 @@ because the name "backlight" would be used as fallback anyway.
 pwm-specifier typically encodes the chip-relative PWM number and the PWM
 period in nanoseconds.
 
-Optionally, the pwm-specifier can encode a number of flags in a third cell:
-- bit 0: PWM signal polarity (0: normal polarity, 1: inverse polarity)
+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
 
 Example with optional PWM specifier for inverse polarity
 
 	bl: backlight {
-		pwms = <&pwm 0 5000000 1>;
+		pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED>;
 		pwm-names = "backlight";
 	};
 
diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h
new file mode 100644
index 0000000..96f49e8
--- /dev/null
+++ b/include/dt-bindings/pwm/pwm.h
@@ -0,0 +1,14 @@
+/*
+ * This header provides constants for most PWM bindings.
+ *
+ * Most PWM bindings can include a flags cell as part of the PWM specifier.
+ * In most cases, the format of the flags cell uses the standard values
+ * defined in this header.
+ */
+
+#ifndef _DT_BINDINGS_PWM_PWM_H
+#define _DT_BINDINGS_PWM_PWM_H
+
+#define PWM_POLARITY_INVERTED			(1 << 0)
+
+#endif
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/4] pwm: Use the DT macro directly when parsing PWM DT flags
  2013-07-17 22:54 [PATCH v2 0/4] Add PWM polarity flag macro for DT Laurent Pinchart
  2013-07-17 22:54 ` [PATCH v2 1/4] pwm: " Laurent Pinchart
@ 2013-07-17 22:54 ` Laurent Pinchart
       [not found] ` <1374101664-21112-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2013-07-17 22:54 UTC (permalink / raw)
  To: Thierry Reding
  Cc: devicetree-discuss, linux-omap, linux-pwm, linux-arm-kernel,
	Boris BREZILLON, Shawn Guo, Steffen Trumtrar, Stephen Warren,
	Tomasz Figa

Don't redefine a PWM_SPEC_POLARITY macro with a value identical to
PWM_POLARITY_INVERTED, use the PWM DT macro directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/pwm/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index dfbfbc5..2ca9504 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -30,10 +30,9 @@
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
 
-#define MAX_PWMS 1024
+#include <dt-bindings/pwm/pwm.h>
 
-/* flags in the third cell of the DT PWM specifier */
-#define PWM_SPEC_POLARITY	(1 << 0)
+#define MAX_PWMS 1024
 
 static DEFINE_MUTEX(pwm_lookup_lock);
 static LIST_HEAD(pwm_lookup_list);
@@ -149,7 +148,7 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
 
 	pwm_set_period(pwm, args->args[1]);
 
-	if (args->args[2] & PWM_SPEC_POLARITY)
+	if (args->args[2] & PWM_POLARITY_INVERTED)
 		pwm_set_polarity(pwm, PWM_POLARITY_INVERSED);
 	else
 		pwm_set_polarity(pwm, PWM_POLARITY_NORMAL);
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 3/4] pwm: Update DT bindings to reference pwm.txt for cells documentation
       [not found] ` <1374101664-21112-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
@ 2013-07-17 22:54   ` Laurent Pinchart
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2013-07-17 22:54 UTC (permalink / raw)
  To: Thierry Reding
  Cc: linux-pwm-u79uwXL29TY76Z2rM5mHXA, Boris BREZILLON,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Steffen Trumtrar,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

The PWM client cells format is documented in the generic pwm.txt
documentation and duplicated in all PWM driver bindings. Remove
duplicate information and reference pwm.txt instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
---
 Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt      |  8 +++-----
 Documentation/devicetree/bindings/pwm/imx-pwm.txt            |  4 ++--
 Documentation/devicetree/bindings/pwm/mxs-pwm.txt            |  4 ++--
 Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt |  5 ++---
 Documentation/devicetree/bindings/pwm/nxp,pca9685-pwm.txt    |  4 ++--
 Documentation/devicetree/bindings/pwm/pwm-samsung.txt        | 10 +++-------
 Documentation/devicetree/bindings/pwm/pwm-tiecap.txt         |  8 +++-----
 Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt       |  8 +++-----
 Documentation/devicetree/bindings/pwm/spear-pwm.txt          |  5 ++---
 Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt         |  4 ++--
 Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt      |  4 ++--
 Documentation/devicetree/bindings/pwm/vt8500-pwm.txt         |  8 +++-----
 12 files changed, 29 insertions(+), 43 deletions(-)

diff --git a/Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt
index de0eaed..8031148 100644
--- a/Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt
@@ -2,11 +2,9 @@ Atmel TCB PWM controller
 
 Required properties:
 - compatible: should be "atmel,tcb-pwm"
-- #pwm-cells: Should be 3.  The first cell specifies the per-chip index
-  of the PWM to use, the second cell is the period in nanoseconds and
-  bit 0 in the third cell is used to encode the polarity of PWM output.
-  Set bit 0 of the third cell in PWM specifier to 1 for inverse polarity &
-  set to 0 for normal polarity.
+- #pwm-cells: should be 3. See pwm.txt in this directory for a description of
+  the cells format. The only third cell flag supported by this binding is
+  PWM_POLARITY_INVERTED.
 - tc-block: The Timer Counter block to use as a PWM chip.
 
 Example:
diff --git a/Documentation/devicetree/bindings/pwm/imx-pwm.txt b/Documentation/devicetree/bindings/pwm/imx-pwm.txt
index 8522bfb..b50d7a6d 100644
--- a/Documentation/devicetree/bindings/pwm/imx-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/imx-pwm.txt
@@ -3,8 +3,8 @@ Freescale i.MX PWM controller
 Required properties:
 - compatible: should be "fsl,<soc>-pwm"
 - reg: physical base address and length of the controller's registers
-- #pwm-cells: should be 2.  The first cell specifies the per-chip index
-  of the PWM to use and the second cell is the period in nanoseconds.
+- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
+  the cells format.
 - interrupts: The interrupt for the pwm controller
 
 Example:
diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.txt b/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
index 9e3f8f1..96cdde5 100644
--- a/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
@@ -3,8 +3,8 @@ Freescale MXS PWM controller
 Required properties:
 - compatible: should be "fsl,imx23-pwm"
 - reg: physical base address and length of the controller's registers
-- #pwm-cells: should be 2.  The first cell specifies the per-chip index
-  of the PWM to use and the second cell is the period in nanoseconds.
+- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
+  the cells format.
 - fsl,pwm-number: the number of PWM devices
 
 Example:
diff --git a/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt b/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt
index 01438ec..c3fc57a 100644
--- a/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt
@@ -5,9 +5,8 @@ Required properties:
   - "nvidia,tegra20-pwm"
   - "nvidia,tegra30-pwm"
 - reg: physical base address and length of the controller's registers
-- #pwm-cells: On Tegra the number of cells used to specify a PWM is 2. The
-  first cell specifies the per-chip index of the PWM to use and the second
-  cell is the period in nanoseconds.
+- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
+  the cells format.
 
 Example:
 
diff --git a/Documentation/devicetree/bindings/pwm/nxp,pca9685-pwm.txt b/Documentation/devicetree/bindings/pwm/nxp,pca9685-pwm.txt
index 1e3dfe7..f84ec9d 100644
--- a/Documentation/devicetree/bindings/pwm/nxp,pca9685-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/nxp,pca9685-pwm.txt
@@ -3,8 +3,8 @@ NXP PCA9685 16-channel 12-bit PWM LED controller
 
 Required properties:
   - compatible: "nxp,pca9685-pwm"
-  - #pwm-cells: should be 2. The first cell specifies the per-chip index
-    of the PWM to use and the second cell is the period in nanoseconds.
+  - #pwm-cells: Should be 2. See pwm.txt in this directory for a description of
+    the cells format.
     The index 16 is the ALLCALL channel, that sets all PWM channels at the same
     time.
 
diff --git a/Documentation/devicetree/bindings/pwm/pwm-samsung.txt b/Documentation/devicetree/bindings/pwm/pwm-samsung.txt
index ac67c68..4caa1a7 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-samsung.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-samsung.txt
@@ -19,13 +19,9 @@ Required properties:
 - reg: base address and size of register area
 - interrupts: list of timer interrupts (one interrupt per timer, starting at
   timer 0)
-- #pwm-cells: number of cells used for PWM specifier - must be 3
-   the specifier format is as follows:
-     - phandle to PWM controller node
-     - index of PWM channel (from 0 to 4)
-     - PWM signal period in nanoseconds
-     - bitmask of optional PWM flags:
-        0x1 - invert PWM signal
+- #pwm-cells: should be 3. See pwm.txt in this directory for a description of
+  the cells format. The only third cell flag supported by this binding is
+  PWM_POLARITY_INVERTED.
 
 Optional properties:
 - samsung,pwm-outputs: list of PWM channels used as PWM outputs on particular
diff --git a/Documentation/devicetree/bindings/pwm/pwm-tiecap.txt b/Documentation/devicetree/bindings/pwm/pwm-tiecap.txt
index 681afad..fb81179 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-tiecap.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-tiecap.txt
@@ -4,11 +4,9 @@ Required properties:
 - compatible: Must be "ti,<soc>-ecap".
   for am33xx - compatible = "ti,am33xx-ecap";
   for da850  - compatible = "ti,da850-ecap", "ti,am33xx-ecap";
-- #pwm-cells: Should be 3. Number of cells being used to specify PWM property.
-  First cell specifies the per-chip index of the PWM to use, the second
-  cell is the period in nanoseconds and bit 0 in the third cell is used to
-  encode the polarity of PWM output. Set bit 0 of the third in PWM specifier
-  to 1 for inverse polarity & set to 0 for normal polarity.
+- #pwm-cells: should be 3. See pwm.txt in this directory for a description of
+  the cells format. The PWM channel index ranges from 0 to 4. The only third
+  cell flag supported by this binding is PWM_POLARITY_INVERTED.
 - reg: physical base address and size of the registers map.
 
 Optional properties:
diff --git a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
index 337c6fc..9c100b2 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
@@ -4,11 +4,9 @@ Required properties:
 - compatible: Must be "ti,<soc>-ehrpwm".
   for am33xx - compatible = "ti,am33xx-ehrpwm";
   for da850  - compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
-- #pwm-cells: Should be 3. Number of cells being used to specify PWM property.
-  First cell specifies the per-chip index of the PWM to use, the second
-  cell is the period in nanoseconds and bit 0 in the third cell is used to
-  encode the polarity of PWM output. Set bit 0 of the third in PWM specifier
-  to 1 for inverse polarity & set to 0 for normal polarity.
+- #pwm-cells: should be 3. See pwm.txt in this directory for a description of
+  the cells format. The only third cell flag supported by this binding is
+  PWM_POLARITY_INVERTED.
 - reg: physical base address and size of the registers map.
 
 Optional properties:
diff --git a/Documentation/devicetree/bindings/pwm/spear-pwm.txt b/Documentation/devicetree/bindings/pwm/spear-pwm.txt
index 3ac779d..b486de2 100644
--- a/Documentation/devicetree/bindings/pwm/spear-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/spear-pwm.txt
@@ -5,9 +5,8 @@ Required properties:
   - "st,spear320-pwm"
   - "st,spear1340-pwm"
 - reg: physical base address and length of the controller's registers
-- #pwm-cells: number of cells used to specify PWM which is fixed to 2 on
-  SPEAr. The first cell specifies the per-chip index of the PWM to use and
-  the second cell is the period in nanoseconds.
+- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
+  the cells format.
 
 Example:
 
diff --git a/Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt b/Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt
index 2943ee5..4e32bee 100644
--- a/Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt
@@ -6,8 +6,8 @@ On TWL6030 series: PWM0 and PWM1
 
 Required properties:
 - compatible: "ti,twl4030-pwm" or "ti,twl6030-pwm"
-- #pwm-cells: should be 2.  The first cell specifies the per-chip index
-  of the PWM to use and the second cell is the period in nanoseconds.
+- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
+  the cells format.
 
 Example:
 
diff --git a/Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt b/Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt
index cb64f3a..9f4b460 100644
--- a/Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt
+++ b/Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt
@@ -6,8 +6,8 @@ On TWL6030 series: LED PWM (mainly used as charging indicator LED)
 
 Required properties:
 - compatible: "ti,twl4030-pwmled" or "ti,twl6030-pwmled"
-- #pwm-cells: should be 2.  The first cell specifies the per-chip index
-  of the PWM to use and the second cell is the period in nanoseconds.
+- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
+  the cells format.
 
 Example:
 
diff --git a/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt b/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt
index d21d82d..a76390e 100644
--- a/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt
@@ -3,11 +3,9 @@ VIA/Wondermedia VT8500/WM8xxx series SoC PWM controller
 Required properties:
 - compatible: should be "via,vt8500-pwm"
 - reg: physical base address and length of the controller's registers
-- #pwm-cells: Should be 3. Number of cells being used to specify PWM property.
-  First cell specifies the per-chip index of the PWM to use, the second
-  cell is the period in nanoseconds and bit 0 in the third cell is used to
-  encode the polarity of PWM output. Set bit 0 of the third in PWM specifier
-  to 1 for inverse polarity & set to 0 for normal polarity.
+- #pwm-cells: should be 3. See pwm.txt in this directory for a description of
+  the cells format. The only third cell flag supported by this binding is
+  PWM_POLARITY_INVERTED.
 - clocks: phandle to the PWM source clock
 
 Example:
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 4/4] ARM: dts: Use the PWM polarity flags
  2013-07-17 22:54 [PATCH v2 0/4] Add PWM polarity flag macro for DT Laurent Pinchart
                   ` (2 preceding siblings ...)
       [not found] ` <1374101664-21112-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
@ 2013-07-17 22:54 ` Laurent Pinchart
  2013-07-18 16:55 ` [PATCH v2 0/4] Add PWM polarity flag macro for DT Stephen Warren
  4 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2013-07-17 22:54 UTC (permalink / raw)
  To: Thierry Reding
  Cc: devicetree-discuss, linux-omap, linux-pwm, linux-arm-kernel,
	Boris BREZILLON, Shawn Guo, Steffen Trumtrar, Stephen Warren,
	Tomasz Figa

Replace the numerical polarity flags with the PWM_POLARITY_INVERTED
symbolic constant.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 arch/arm/boot/dts/am335x-evmsk.dts | 3 ++-
 arch/arm/boot/dts/wm8850-w70v2.dts | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 0c8ad17..62124c7 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -14,6 +14,7 @@
 /dts-v1/;
 
 #include "am33xx.dtsi"
+#include <dt-bindings/pwm/pwm.h>
 
 / {
 	model = "TI AM335x EVM-SK";
@@ -298,7 +299,7 @@
 
 	backlight {
 		compatible = "pwm-backlight";
-		pwms = <&ecap2 0 50000 1>;
+		pwms = <&ecap2 0 50000 PWM_POLARITY_INVERTED>;
 		brightness-levels = <0 58 61 66 75 90 125 170 255>;
 		default-brightness-level = <8>;
 	};
diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts
index 90e913f..7a563d2 100644
--- a/arch/arm/boot/dts/wm8850-w70v2.dts
+++ b/arch/arm/boot/dts/wm8850-w70v2.dts
@@ -11,13 +11,14 @@
 
 /dts-v1/;
 /include/ "wm8850.dtsi"
+#include <dt-bindings/pwm/pwm.h>
 
 / {
 	model = "Wondermedia WM8850-W70v2 Tablet";
 
 	backlight {
 		compatible = "pwm-backlight";
-		pwms = <&pwm 0 50000 1>;	/* duty inverted */
+		pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
 
 		brightness-levels = <0 40 60 80 100 130 190 255>;
 		default-brightness-level = <5>;
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/4] Add PWM polarity flag macro for DT
  2013-07-17 22:54 [PATCH v2 0/4] Add PWM polarity flag macro for DT Laurent Pinchart
                   ` (3 preceding siblings ...)
  2013-07-17 22:54 ` [PATCH v2 4/4] ARM: dts: Use the PWM polarity flags Laurent Pinchart
@ 2013-07-18 16:55 ` Stephen Warren
  2013-07-19 11:29   ` Laurent Pinchart
  4 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2013-07-18 16:55 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Thierry Reding, devicetree-discuss, linux-omap, linux-pwm,
	linux-arm-kernel, Boris BREZILLON, Shawn Guo, Steffen Trumtrar,
	Tomasz Figa

On 07/17/2013 04:54 PM, Laurent Pinchart wrote:
> Hello,
> 
> Here's a small patch set that replaces PWM polarity numerical constants with
> macros in DT.

The series,
Reviewed-by: Stephen Warren <swarren@nvidia.com>

I'm (very very) slightly hesitant about patch 3/4, since it's moving
towards all PWMs having to use the same specifier format, whereas
specifiers are at least potentially binding-specific, not
device-type-specific. However, consistency is good; there's no need to
do something different just for the heck of it. Equally, there's nothing
actually stopping a new binding from defining its own format rather than
simply deferring to pwm.txt if it absolutely has to, so I think this
will turn out fine.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/4] Add PWM polarity flag macro for DT
  2013-07-18 16:55 ` [PATCH v2 0/4] Add PWM polarity flag macro for DT Stephen Warren
@ 2013-07-19 11:29   ` Laurent Pinchart
  2013-07-23 15:37     ` Thierry Reding
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2013-07-19 11:29 UTC (permalink / raw)
  To: Stephen Warren, Thierry Reding
  Cc: devicetree-discuss, linux-omap, linux-pwm, linux-arm-kernel,
	Boris BREZILLON, Shawn Guo, Steffen Trumtrar, Tomasz Figa

Hi Stephen,

On Thursday 18 July 2013 10:55:56 Stephen Warren wrote:
> On 07/17/2013 04:54 PM, Laurent Pinchart wrote:
> > Hello,
> > 
> > Here's a small patch set that replaces PWM polarity numerical constants
> > with macros in DT.
> 
> The series,
> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> 
> I'm (very very) slightly hesitant about patch 3/4, since it's moving towards
> all PWMs having to use the same specifier format, whereas specifiers are at
> least potentially binding-specific, not device-type-specific. However,
> consistency is good; there's no need to do something different just for the
> heck of it. Equally, there's nothing actually stopping a new binding from
> defining its own format rather than simply deferring to pwm.txt if it
> absolutely has to, so I think this will turn out fine.

Exactly, that's why I don't think it's an issue. pwm.txt defines a common 
format, individual bindings are free to use it or not.

Thierry, if you're fine with the patches, could you take them in your tree 
with Stephen's Reviewed-by, or should I report them and send you a pull 
request ?

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/4] Add PWM polarity flag macro for DT
  2013-07-19 11:29   ` Laurent Pinchart
@ 2013-07-23 15:37     ` Thierry Reding
  0 siblings, 0 replies; 8+ messages in thread
From: Thierry Reding @ 2013-07-23 15:37 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Stephen Warren, devicetree-discuss, linux-omap, linux-pwm,
	linux-arm-kernel, Boris BREZILLON, Shawn Guo, Steffen Trumtrar,
	Tomasz Figa

[-- Attachment #1: Type: text/plain, Size: 1437 bytes --]

On Fri, Jul 19, 2013 at 01:29:13PM +0200, Laurent Pinchart wrote:
> Hi Stephen,
> 
> On Thursday 18 July 2013 10:55:56 Stephen Warren wrote:
> > On 07/17/2013 04:54 PM, Laurent Pinchart wrote:
> > > Hello,
> > > 
> > > Here's a small patch set that replaces PWM polarity numerical constants
> > > with macros in DT.
> > 
> > The series,
> > Reviewed-by: Stephen Warren <swarren@nvidia.com>
> > 
> > I'm (very very) slightly hesitant about patch 3/4, since it's moving towards
> > all PWMs having to use the same specifier format, whereas specifiers are at
> > least potentially binding-specific, not device-type-specific. However,
> > consistency is good; there's no need to do something different just for the
> > heck of it. Equally, there's nothing actually stopping a new binding from
> > defining its own format rather than simply deferring to pwm.txt if it
> > absolutely has to, so I think this will turn out fine.
> 
> Exactly, that's why I don't think it's an issue. pwm.txt defines a common 
> format, individual bindings are free to use it or not.
> 
> Thierry, if you're fine with the patches, could you take them in your tree 
> with Stephen's Reviewed-by, or should I report them and send you a pull 
> request ?

They look good to me. I'll take them into my tree and add Stephen's
Reviwed-by. It might take me another week, though, as I'm currently
rather busy with other things.

Thierry

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-23 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-17 22:54 [PATCH v2 0/4] Add PWM polarity flag macro for DT Laurent Pinchart
2013-07-17 22:54 ` [PATCH v2 1/4] pwm: " Laurent Pinchart
2013-07-17 22:54 ` [PATCH v2 2/4] pwm: Use the DT macro directly when parsing PWM DT flags Laurent Pinchart
     [not found] ` <1374101664-21112-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2013-07-17 22:54   ` [PATCH v2 3/4] pwm: Update DT bindings to reference pwm.txt for cells documentation Laurent Pinchart
2013-07-17 22:54 ` [PATCH v2 4/4] ARM: dts: Use the PWM polarity flags Laurent Pinchart
2013-07-18 16:55 ` [PATCH v2 0/4] Add PWM polarity flag macro for DT Stephen Warren
2013-07-19 11:29   ` Laurent Pinchart
2013-07-23 15:37     ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).