Vladimir Zapolskiy
2014-10-10 15:50:05 UTC
The third optional argument of pwms is well defined as polarity and it
is already used in a number of pwm drivers, so, to minimize changes in
the remaining drivers which are to be updated accordingly set polarity
in default of_xlate() function.
Signed-off-by: Vladimir Zapolskiy <***@mentor.com>
Cc: Lothar Wa=C3=9Fmann <***@KARO-electronics.de>
Cc: Sascha Hauer <***@pengutronix.de>
Cc: Thierry Reding <***@gmail.com>
Cc: Shawn Guo <***@linaro.org>
---
drivers/pwm/core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 966497d..681d154 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -174,6 +174,13 @@ of_pwm_simple_xlate(struct pwm_chip *pc, const str=
uct of_phandle_args *args)
=20
pwm_set_period(pwm, args->args[1]);
=20
+ if (pc->of_pwm_n_cells > 2) {
+ if (args->args[2] & PWM_POLARITY_INVERTED)
+ pwm_set_polarity(pwm, PWM_POLARITY_INVERSED);
+ else
+ pwm_set_polarity(pwm, PWM_POLARITY_NORMAL);
+ }
+
return pwm;
}
=20
--=20
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-pwm" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
is already used in a number of pwm drivers, so, to minimize changes in
the remaining drivers which are to be updated accordingly set polarity
in default of_xlate() function.
Signed-off-by: Vladimir Zapolskiy <***@mentor.com>
Cc: Lothar Wa=C3=9Fmann <***@KARO-electronics.de>
Cc: Sascha Hauer <***@pengutronix.de>
Cc: Thierry Reding <***@gmail.com>
Cc: Shawn Guo <***@linaro.org>
---
drivers/pwm/core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 966497d..681d154 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -174,6 +174,13 @@ of_pwm_simple_xlate(struct pwm_chip *pc, const str=
uct of_phandle_args *args)
=20
pwm_set_period(pwm, args->args[1]);
=20
+ if (pc->of_pwm_n_cells > 2) {
+ if (args->args[2] & PWM_POLARITY_INVERTED)
+ pwm_set_polarity(pwm, PWM_POLARITY_INVERSED);
+ else
+ pwm_set_polarity(pwm, PWM_POLARITY_NORMAL);
+ }
+
return pwm;
}
=20
--=20
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-pwm" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html