pwm: bcm2835: Support for polarity setting via DT
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 12 Aug 2017 10:19:44 +0000 (12:19 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 21 Aug 2017 05:27:58 +0000 (07:27 +0200)
This adds support for the third (optional) pwm cell to specify the
polarity, which is needed by display backlights for example.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-bcm2835.c

index c5dbf16d810ba663ba4ef5637c380317be0e7180..db001cba937fd8617fc81720e21c30601f2bfec5 100644 (file)
@@ -167,6 +167,8 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
        pc->chip.dev = &pdev->dev;
        pc->chip.ops = &bcm2835_pwm_ops;
        pc->chip.npwm = 2;
+       pc->chip.of_xlate = of_pwm_xlate_with_flags;
+       pc->chip.of_pwm_n_cells = 3;
 
        platform_set_drvdata(pdev, pc);