Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3601116imm; Wed, 5 Sep 2018 02:55:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaUlYO7ua8t/VbJ7fY++sN1fdGtJhhGk+0CA18my1kDH6EbyOPh3qkHlWuVzAg9a3Yx4eLV X-Received: by 2002:a65:50c9:: with SMTP id s9-v6mr17182812pgp.417.1536141328105; Wed, 05 Sep 2018 02:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536141328; cv=none; d=google.com; s=arc-20160816; b=lpKG8SRg8KgEyoiwYv0bhRCqhSmbJU3LEyivdWW8jIVUW+MJkBXjlTuTbE1lyp/u4U lc4Psdv1lZt5i/zB2lrzBtz4NxvmrE03t2R5GRDGqdGbNvAMdj3lw/iVxFN8upgdB/4b ritgFx60o4ScZMJR5xzaJ028CNxp3dMvgKc5FmdJuxztYsYSUw8MKWPcaWHrKS5sXSNT zXTmWjmVSuQhesMCnmccvXZg43K1Fs0GknJdm+fMpsGcTa31yzxZtzDHsWf1Wx2HcXQS W/8RseXKoQJDF0J8JeRDMXxaS6cvd7PF3eYl+bVHR0t4OEcCbq1WZuEg6FwGHvhmHbDY td4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oucGnZ6bTwxrV1IQLnexou70gi17vAHjv0t3NlNM3gk=; b=DUleZpLyxwOPc+pQpIcrq6N+Ak1U2xaQMK2ip6smX4fE+MbPMI4Lou668xXn7QBoMJ 8WL05Z7cimN08fW4hJiExk6f0zwJELFgG099rmXjRIKTgXc3Pe6EGSkk1+sxGIx1dw45 EVbHcPktDjG46S9GtZkl4xFHi+IK3kiXeFEFOQDgH28eaLdgniPKUf0w3AXxK1gOFeOL QnFCgxliZybiW4M0E6VwUffdhd1ABa/1qL+mCxrd7nVbqk5ZmuPhdK7CNZptTAoLcR2Y /NFQ66HA1eLSuA6sx/cRqDXCU5QTbf+436TIdiBhC42Bv5XJSQRa67m9Iv6Vott+XkG8 0/Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61-v6si1544152plc.239.2018.09.05.02.55.13; Wed, 05 Sep 2018 02:55:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbeIEOWZ (ORCPT + 99 others); Wed, 5 Sep 2018 10:22:25 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:33948 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726999AbeIEOWZ (ORCPT ); Wed, 5 Sep 2018 10:22:25 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 616B580643; Wed, 5 Sep 2018 11:52:57 +0200 (CEST) Date: Wed, 5 Sep 2018 11:52:54 +0200 From: Pavel Machek To: Michal =?utf-8?B?Vm9rw6HEjQ==?= Cc: Song Qiang , jacek.anaszewski@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Song Qiang Subject: Re: [PATCH] leds: leds-gpio: Add a condition check for active low leds. Message-ID: <20180905095254.GA9579@amd> References: <20180905023436.11826-1-songqiang.1304521@gmail.com> <13a8d001-a44a-51a0-146b-ba5aa3f6e621@ysoft.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <13a8d001-a44a-51a0-146b-ba5aa3f6e621@ysoft.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-09-05 09:44:04, Michal Vok=C3=A1=C4=8D wrote: > Hi Song, > On 5.9.2018 04:34, Song Qiang wrote: > >Some leds on our board are active low leds, which means these leds > >are lighted when the corresponding gpio line is low, while the > >original leds-gpio driver default all leds are active high leds. > >This patch adds a devicetree node "light-state", whose value should > >be "high" for active high leds and "low" for active low leds. > >The default value is "high" for compatible for the original driver. > > > >Signed-off-by: Song Qiang > >--- > > .../devicetree/bindings/leds/leds-gpio.txt | 15 +++++++++++ > > drivers/leds/leds-gpio.c | 25 +++++++++++++++++-- > > 2 files changed, 38 insertions(+), 2 deletions(-) > > > >diff --git a/Documentation/devicetree/bindings/leds/leds-gpio.txt b/Docu= mentation/devicetree/bindings/leds/leds-gpio.txt > >index a48dda268f81..0a8fad75c704 100644 > >--- a/Documentation/devicetree/bindings/leds/leds-gpio.txt > >+++ b/Documentation/devicetree/bindings/leds/leds-gpio.txt > >@@ -23,6 +23,9 @@ LED sub-node properties: > > remains up. > > - panic-indicator : (optional) > > see Documentation/devicetree/bindings/leds/common.txt > >+- light-state: (optional) Values should be "high" or "low", which indic= ates > >+ the state of the GPIO pin when the led is on. > >+ see Documentation/devicetree/bindings/leds/common.txt > > Examples: > >@@ -64,3 +67,15 @@ leds { > > retain-state-suspended; > > }; > > }; > >+ > >+leds { > >+ compatible =3D "gpio-leds"; > >+ > >+ led0 { > >+ label =3D "led0"; > >+ gpios =3D <&gpio1 19 GPIO_ACTIVE_HIGH>; >=20 > With this patch you are introducing one more way to invert the logic. > If your LED is active LOW, you should use GPIO_ACTIVE_LOW in your DT. > All should work as expected then. Exactly, GPIO subsystem already has ways to specify active-low and active-high. NAK. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAluPp3YACgkQMOfwapXb+vKGQwCgssYzLEADPlcHF0mc1LMt1UF6 XiEAn3GbSIgmQFeR5Isg715BwiNUh6ZH =Utpm -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT--