lkml.org 
[lkml]   [2018]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/3] leds: upboard: Add LED support
From
Date
On 10/23/2018 08:54 PM, Pavel Machek wrote:
> Hi!
>
>>> + led->field = devm_regmap_field_alloc(dev, regmap, conf);
>>> + if (IS_ERR(led->field))
>>> + return PTR_ERR(led->field);
>>> +
>>> + led->cdev.max_brightness = 1;
>>
>> s/1/LED_ON/
>
> Actually, I prefer constant 1 here, as it makes it immediately obvious
> this supports just 0/1.
>
> Yes, LED_ON is also 1, but I had to grep the header files for
> that... (I thought it was 255).

If we have the enum for that, let's use it.
Here's the commit message of the patch adding LED_ON - it should
be somehow familiar to you - see the ack.

commit 4e552c8cb5bc9137e67e035bab8df6dddbca7384
Author: Andi Shyti <andi.shyti@samsung.com>
Date: Thu Jan 5 11:34:12 2017 +0900

leds: add LED_ON brightness as boolean value

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>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>


--
Best regards,
Jacek Anaszewski

\
 
 \ /
  Last update: 2018-10-23 21:10    [W:0.098 / U:6.100 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site