Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9344dade authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Thierry Reding
Browse files

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: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarStephen Warren <swarren@nvidia.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent cfb9e4c4
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -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
pwm-specifier typically encodes the chip-relative PWM number and the PWM
period in nanoseconds.
period in nanoseconds.


Optionally, the pwm-specifier can encode a number of flags in a third cell:
Optionally, the pwm-specifier can encode a number of flags (defined in
- bit 0: PWM signal polarity (0: normal polarity, 1: inverse polarity)
<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
Example with optional PWM specifier for inverse polarity


	bl: backlight {
	bl: backlight {
		pwms = <&pwm 0 5000000 1>;
		pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED>;
		pwm-names = "backlight";
		pwm-names = "backlight";
	};
	};


+14 −0
Original line number Original line Diff line number Diff line
/*
 * 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