From patchwork Sun Apr 6 22:20:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 337294 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C43441400C6 for ; Mon, 7 Apr 2014 08:20:30 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754628AbaDFWU3 (ORCPT ); Sun, 6 Apr 2014 18:20:29 -0400 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:51986 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754121AbaDFWU2 (ORCPT ); Sun, 6 Apr 2014 18:20:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora; h=Date:Sender:Message-Id:Subject:Cc:To:From:References:In-Reply-To; bh=NfgClWBedwZnJlcKSnLIDnE7i0RmPr5fyfEAz8yKUoY=; b=od9CodJqs8rgY18tmRiyLifYXIaMpinCaIdtZp4HFFQgykIH9qlq28zz96JIkehSpgsvDIxPIWHNq0HwtcTTWtNJzl8fXc/rThI8YG7MIJII06zlRNM/KBlY/S9VPLKQZ4cIZLo9F1Cen/UedV13mMH4OIIAVvtiiMSAyUCdkAU=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:41362 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1WWvQO-0003Y4-Hf; Sun, 06 Apr 2014 23:20:24 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1WWvQO-00049j-36; Sun, 06 Apr 2014 23:20:24 +0100 In-Reply-To: <20140406221854.GS7528@n2100.arm.linux.org.uk> References: <20140406221854.GS7528@n2100.arm.linux.org.uk> From: Russell King To: Bryan Wu , Richard Purdie Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Randy Dunlap , 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 Message-Id: Date: Sun, 06 Apr 2014 23:20:24 +0100 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- 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);