All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-leds@vger.kernel.org
Subject: [PATCH 5/5] leds: leds-pwm: add DT support for LEDs wired to supply
Date: Sun, 06 Apr 2014 23:20:24 +0100	[thread overview]
Message-ID: <E1WWvQO-00049j-36@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140406221854.GS7528@n2100.arm.linux.org.uk>

The non-DT driver allowed an active low property to be specified, but DT
is missing this in its description.  Add the property to the DT binding
document, making it optional.  It defaults to active high, which retains
compatibility with existing descriptions.

This should only be used for causes where the LED is wired to supply,
and the PWM does not sensibly support its own inversion.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 Documentation/devicetree/bindings/leds/leds-pwm.txt | 2 ++
 drivers/leds/leds-pwm.c                             | 1 +
 2 files changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.txt b/Documentation/devicetree/bindings/leds/leds-pwm.txt
index 7297107cf832..6c6583c35f2f 100644
--- a/Documentation/devicetree/bindings/leds/leds-pwm.txt
+++ b/Documentation/devicetree/bindings/leds/leds-pwm.txt
@@ -13,6 +13,8 @@ node's name represents the name of the corresponding LED.
   For the pwms and pwm-names property please refer to:
   Documentation/devicetree/bindings/pwm/pwm.txt
 - max-brightness : Maximum brightness possible for the LED
+- active-low : (optional) For PWMs where the LED is wired to supply
+  rather than ground.
 - label :  (optional)
   see Documentation/devicetree/bindings/leds/common.txt
 - linux,default-trigger :  (optional)
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 1d47742c551f..fb1eafe09324 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -155,6 +155,7 @@ static int led_pwm_create_of(struct device *dev, struct led_pwm_priv *priv)
 
 		led.default_trigger = of_get_property(child,
 						"linux,default-trigger", NULL);
+		led.active_low = of_property_read_bool(child, "active-low");
 		of_property_read_u32(child, "max-brightness",
 				     &led.max_brightness);
 
-- 
1.8.3.1


  parent reply	other threads:[~2014-04-06 22:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 22:18 [PATCH 0/5] Fix various issues with leds-pwm Russell King - ARM Linux
2014-04-06 22:20 ` [PATCH 1/5] leds: leds-pwm: properly clean up after probe failure Russell King
2014-04-06 22:20 ` [PATCH 2/5] leds: leds-pwm: provide a common function to setup a single led-pwm device Russell King
2014-04-06 22:20 ` [PATCH 3/5] leds: leds-pwm: convert OF parsing code to use led_pwm_add() Russell King
2014-04-06 22:20 ` [PATCH 4/5] leds: leds-pwm: implement PWM inversion Russell King
2014-04-07  8:46   ` Alexandre Belloni
2014-04-07  8:52     ` Russell King - ARM Linux
2014-04-07  9:28       ` Alexandre Belloni
2014-04-07  9:42         ` Russell King - ARM Linux
2014-04-07 11:10     ` Thierry Reding
2014-04-07 11:35       ` Russell King - ARM Linux
2014-04-07 12:01         ` Thierry Reding
2014-04-07 12:37           ` Russell King - ARM Linux
2014-04-07 13:37             ` Thierry Reding
2014-04-07 14:20               ` Alexandre Belloni
2014-04-07 15:01                 ` Russell King - ARM Linux
2014-04-06 22:20 ` Russell King [this message]
2014-04-07 21:31 ` [PATCH 0/5] Fix various issues with leds-pwm Bryan Wu
2014-04-07 21:33   ` Russell King - ARM Linux
2014-04-07 21:36     ` Bryan Wu
2014-06-12 17:12       ` Russell King - ARM Linux
2014-06-12 17:37         ` Bryan Wu
2014-06-12 17:56           ` Alexandre Belloni
2014-06-12 18:01             ` Bryan Wu
2014-06-12 18:03           ` Russell King - ARM Linux
2014-06-12 18:16             ` Bryan Wu
2014-06-12 18:21               ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1WWvQO-00049j-36@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.