aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-07-17 18:54:21 -0400
committerThierry Reding <thierry.reding@gmail.com>2013-09-03 07:08:09 -0400
commit9344dade4f9438c26f7eb517caeceee4d52a3a68 (patch)
treebb03808265ef5c1d4d1a95b95d7b4eecdb89d074
parentcfb9e4c40e87dffdce96d3a95c33d01f441b2470 (diff)
pwm: Add PWM polarity flag macro for DT
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> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r--Documentation/devicetree/bindings/pwm/pwm.txt7
-rw-r--r--include/dt-bindings/pwm/pwm.h14
2 files changed, 18 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/pwm/pwm.txt b/Documentation/devicetree/bindings/pwm/pwm.txt
index 06e67247859a..8556263b8502 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.
43pwm-specifier typically encodes the chip-relative PWM number and the PWM 43pwm-specifier typically encodes the chip-relative PWM number and the PWM
44period in nanoseconds. 44period in nanoseconds.
45 45
46Optionally, the pwm-specifier can encode a number of flags in a third cell: 46Optionally, the pwm-specifier can encode a number of flags (defined in
47- bit 0: PWM signal polarity (0: normal polarity, 1: inverse polarity) 47<dt-bindings/pwm/pwm.h>) in a third cell:
48- PWM_POLARITY_INVERTED: invert the PWM signal polarity
48 49
49Example with optional PWM specifier for inverse polarity 50Example with optional PWM specifier for inverse polarity
50 51
51 bl: backlight { 52 bl: backlight {
52 pwms = <&pwm 0 5000000 1>; 53 pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED>;
53 pwm-names = "backlight"; 54 pwm-names = "backlight";
54 }; 55 };
55 56
diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h
new file mode 100644
index 000000000000..96f49e82253e
--- /dev/null
+++ b/include/dt-bindings/pwm/pwm.h
@@ -0,0 +1,14 @@
1/*
2 * This header provides constants for most PWM bindings.
3 *
4 * Most PWM bindings can include a flags cell as part of the PWM specifier.
5 * In most cases, the format of the flags cell uses the standard values
6 * defined in this header.
7 */
8
9#ifndef _DT_BINDINGS_PWM_PWM_H
10#define _DT_BINDINGS_PWM_PWM_H
11
12#define PWM_POLARITY_INVERTED (1 << 0)
13
14#endif