* [PATCH] leds: add LED_ON brightness as boolean value [not found] <CGME20170104134122epcas1p48ee63a75c2e159b06d792ec8bc7d4e6d@epcas1p4.samsung.com> @ 2017-01-04 13:41 ` Andi Shyti 2017-01-04 19:59 ` Jacek Anaszewski 0 siblings, 1 reply; 3+ messages in thread From: Andi Shyti @ 2017-01-04 13:41 UTC (permalink / raw) To: Richard Purdie, Jacek Anaszewski, Pavel Machek Cc: linux-leds, linux-kernel, Andi Shyti, Andi Shyti Some devices do not handle the led brightness or simply don't care about it. Conceptually said devices want to just switch on or off the led. It is useless in this case to have a 255 range of brightness, while just having an LED_ON and LED_OFF improves the boolean meaning of the led status. Signed-off-by: Andi Shyti <andi.shyti@samsung.com> --- include/linux/leds.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/leds.h b/include/linux/leds.h index 569cb531094c..0258f9c49034 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -27,6 +27,7 @@ struct device; enum led_brightness { LED_OFF = 0, + LED_ON, LED_HALF = 127, LED_FULL = 255, }; -- 2.11.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] leds: add LED_ON brightness as boolean value 2017-01-04 13:41 ` [PATCH] leds: add LED_ON brightness as boolean value Andi Shyti @ 2017-01-04 19:59 ` Jacek Anaszewski 2017-01-04 22:42 ` Pavel Machek 0 siblings, 1 reply; 3+ messages in thread From: Jacek Anaszewski @ 2017-01-04 19:59 UTC (permalink / raw) To: Andi Shyti, Richard Purdie, Pavel Machek Cc: linux-leds, linux-kernel, Andi Shyti Hi Andi, Thanks for the patch. On 01/04/2017 02:41 PM, Andi Shyti wrote: > Some devices do not handle the led brightness or simply don't > care about it. Conceptually said devices want to just switch on > or off the led. It is useless in this case to have a 255 range > of brightness, while just having an LED_ON and LED_OFF improves > the boolean meaning of the led status. > > Signed-off-by: Andi Shyti <andi.shyti@samsung.com> > --- > include/linux/leds.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 569cb531094c..0258f9c49034 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -27,6 +27,7 @@ struct device; > > enum led_brightness { > LED_OFF = 0, > + LED_ON, Now lack of explicit value assignment to LED_ON looks weird since it is surrounded by other initializer values. I'd prefer to have "LED_ON = 1," in this line. > LED_HALF = 127, > LED_FULL = 255, > }; > -- Best regards, Jacek Anaszewski ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] leds: add LED_ON brightness as boolean value 2017-01-04 19:59 ` Jacek Anaszewski @ 2017-01-04 22:42 ` Pavel Machek 0 siblings, 0 replies; 3+ messages in thread From: Pavel Machek @ 2017-01-04 22:42 UTC (permalink / raw) To: Jacek Anaszewski Cc: Andi Shyti, Richard Purdie, linux-leds, linux-kernel, Andi Shyti [-- Attachment #1: Type: text/plain, Size: 1249 bytes --] Hi! > > Some devices do not handle the led brightness or simply don't > > care about it. Conceptually said devices want to just switch on > > or off the led. It is useless in this case to have a 255 range > > of brightness, while just having an LED_ON and LED_OFF improves > > the boolean meaning of the led status. > > > > Signed-off-by: Andi Shyti <andi.shyti@samsung.com> > > --- > > include/linux/leds.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/linux/leds.h b/include/linux/leds.h > > index 569cb531094c..0258f9c49034 100644 > > --- a/include/linux/leds.h > > +++ b/include/linux/leds.h > > @@ -27,6 +27,7 @@ struct device; > > > > enum led_brightness { > > LED_OFF = 0, > > + LED_ON, > > Now lack of explicit value assignment to LED_ON looks weird > since it is surrounded by other initializer values. > I'd prefer to have "LED_ON = 1," in this line. Yes, please, good idea. (Documentation already says on/off leds should use 0/1. Good.) With "= 1" added for consistency, Acked-by: Pavel Machek <pavel@ucw.cz> Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 181 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-04 22:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20170104134122epcas1p48ee63a75c2e159b06d792ec8bc7d4e6d@epcas1p4.samsung.com>
2017-01-04 13:41 ` [PATCH] leds: add LED_ON brightness as boolean value Andi Shyti
2017-01-04 19:59 ` Jacek Anaszewski
2017-01-04 22:42 ` Pavel Machek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).