Skip to contentSkip to conversation

pwm: bcm2835: Support for polarity setting via DT

PATCH New Stefan Wahren 2 participants 4 messages Aug 12, 2017 – Aug 21, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover pwm: bcm2835: Support for polarity setting via DT

This patch series adds support for the third (optional) pwm cell to specify the polarity.

Changes in V2:
* add ack and review tags

Stefan Wahren (2):
dt-bindings: pwm-bcm2835: Increase pwm-cells
pwm: bcm2835: Support for polarity setting via DT

 Documentation/devicetree/bindings/pwm/pwm-bcm2835.txt | 4 ++--
 drivers/pwm/pwm-bcm2835.c                             | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/2 dt-bindings: pwm-bcm2835: Increase pwm-cells

We need to increase the pwm-cells for the optional flags parameter, before we can implement support for polarity setting via DT.

---
 Documentation/devicetree/bindings/pwm/pwm-bcm2835.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pwm/pwm-bcm2835.txt +2 -2
index cf573e8..8cf87d1 100644
@@ -6,7 +6,7 @@ Required properties:
 - clocks: This clock defines the base clock frequency of the PWM hardware
   system, the period and the duty_cycle of the PWM signal is a multiple of
   the base period.
-- #pwm-cells: Should be 2. See pwm.txt in this directory for a description of
+- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of
   the cells format.
 
 Examples:
@@ -15,7 +15,7 @@ pwm at 2020c000 {
 	compatible = "brcm,bcm2835-pwm";
 	reg = <0x2020c000 0x28>;
 	clocks = <&clk_pwm>;
-	#pwm-cells = <2>;
+	#pwm-cells = <3>;
 };
 
 clocks {
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/2 pwm: bcm2835: Support for polarity setting via DT

In reply to Stefan Wahren

This adds support for the third (optional) pwm cell to specify the polarity, which is needed by display backlights for example.

---
 drivers/pwm/pwm-bcm2835.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pwm/pwm-bcm2835.c +2 -0
index c5dbf16..db001cb 100644
@@ -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);
 
Signature · 1 line
2.7.4
#3 lore raw

v2 cover pwm: bcm2835: Support for polarity setting via DT

In reply to Stefan Wahren
Quoted 6 lines · Stefan Wahren

This patch series adds support for the third (optional) pwm cell to specify the polarity.

Changes in V2:
* add ack and review tags

Quoted 7 lines

Stefan Wahren (2):
dt-bindings: pwm-bcm2835: Increase pwm-cells
pwm: bcm2835: Support for polarity setting via DT

 Documentation/devicetree/bindings/pwm/pwm-bcm2835.txt | 4 ++--
 drivers/pwm/pwm-bcm2835.c                             | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

Both patches applied to for-4.14/drivers, thanks.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170821/d3f57336/attachment.sig>