linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: atmel-hlcdc: Fix default PWM polarity
@ 2016-05-17  9:12 Boris Brezillon
  2016-05-17 11:00 ` Thierry Reding
  0 siblings, 1 reply; 8+ messages in thread
From: Boris Brezillon @ 2016-05-17  9:12 UTC (permalink / raw)
  To: Thierry Reding, linux-pwm
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Alexandre Belloni, linux-arm-kernel, Boris Brezillon

The PWM device exposed by the HLCDC IP is configured with an inverted
polarity by default. Registering the PWM chip with the normal polarity
was not a problem before commit 42e8992c58d4 ("pwm: Add core
infrastructure to allow atomic updates") because the ->set_polarity()
hook was called no matter the current polarity state, but this is no longer
the case.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: 42e8992c58d4 ("pwm: Add core infrastructure to allow atomic updates")
---
 drivers/pwm/pwm-atmel-hlcdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c
index f994c7e..14fc011 100644
--- a/drivers/pwm/pwm-atmel-hlcdc.c
+++ b/drivers/pwm/pwm-atmel-hlcdc.c
@@ -272,7 +272,7 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev)
 	chip->chip.of_pwm_n_cells = 3;
 	chip->chip.can_sleep = 1;
 
-	ret = pwmchip_add(&chip->chip);
+	ret = pwmchip_add_with_polarity(&chip->chip, PWM_POLARITY_INVERSED);
 	if (ret) {
 		clk_disable_unprepare(hlcdc->periph_clk);
 		return ret;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-14  8:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17  9:12 [PATCH] pwm: atmel-hlcdc: Fix default PWM polarity Boris Brezillon
2016-05-17 11:00 ` Thierry Reding
2016-05-17 11:04   ` Boris Brezillon
2016-05-17 12:08   ` Boris Brezillon
2016-05-17 12:19     ` Thierry Reding
2016-05-17 12:27       ` Boris Brezillon
2016-06-14  7:58   ` Boris Brezillon
2016-06-14  8:55     ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).