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

Commit 208be769 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Thierry Reding
Browse files

pwm: Use the DT macro directly when parsing PWM DT flags



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: 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 9344dade
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -30,10 +30,9 @@
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include <linux/seq_file.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 MAX_PWMS 1024
#define PWM_SPEC_POLARITY	(1 << 0)


static DEFINE_MUTEX(pwm_lookup_lock);
static DEFINE_MUTEX(pwm_lookup_lock);
static LIST_HEAD(pwm_lookup_list);
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]);
	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);
		pwm_set_polarity(pwm, PWM_POLARITY_INVERSED);
	else
	else
		pwm_set_polarity(pwm, PWM_POLARITY_NORMAL);
		pwm_set_polarity(pwm, PWM_POLARITY_NORMAL);