aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/core.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-07-17 18:54:22 -0400
committerThierry Reding <thierry.reding@gmail.com>2013-09-03 07:08:10 -0400
commit208be7698fe39d54242348aef375fd86180c4506 (patch)
tree783a8adc93f7f0757f15de579e9a280874639531 /drivers/pwm/core.c
parent9344dade4f9438c26f7eb517caeceee4d52a3a68 (diff)
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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/core.c')
-rw-r--r--drivers/pwm/core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index dfbfbc521768..2ca95042a0b9 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -30,10 +30,9 @@
30#include <linux/debugfs.h> 30#include <linux/debugfs.h>
31#include <linux/seq_file.h> 31#include <linux/seq_file.h>
32 32
33#define MAX_PWMS 1024 33#include <dt-bindings/pwm/pwm.h>
34 34
35/* flags in the third cell of the DT PWM specifier */ 35#define MAX_PWMS 1024
36#define PWM_SPEC_POLARITY (1 << 0)
37 36
38static DEFINE_MUTEX(pwm_lookup_lock); 37static DEFINE_MUTEX(pwm_lookup_lock);
39static LIST_HEAD(pwm_lookup_list); 38static LIST_HEAD(pwm_lookup_list);
@@ -149,7 +148,7 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
149 148
150 pwm_set_period(pwm, args->args[1]); 149 pwm_set_period(pwm, args->args[1]);
151 150
152 if (args->args[2] & PWM_SPEC_POLARITY) 151 if (args->args[2] & PWM_POLARITY_INVERTED)
153 pwm_set_polarity(pwm, PWM_POLARITY_INVERSED); 152 pwm_set_polarity(pwm, PWM_POLARITY_INVERSED);
154 else 153 else
155 pwm_set_polarity(pwm, PWM_POLARITY_NORMAL); 154 pwm_set_polarity(pwm, PWM_POLARITY_NORMAL);