lkml.org 
[lkml]   [2019]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7 11/12] leds: Add common LED binding parsing support to LED class/core
Date
Hello Again Pavel,

On Sat, 2019-12-21 at 20:37 +0100, Pavel Machek wrote:
> > +static void led_add_props(struct led_classdev *ld, struct
> > led_properties *props)
> > +{
> > + if (props->default_trigger)
> > + ld->default_trigger = props->default_trigger;
> > + /*
> > + * According to binding docs the LED is by-default turned OFF
> > unless
> > + * default_state is used to indicate it should be ON or that
> > state
> > + * should be kept as is
> > + */
> > + if (props->default_state) {
> > + ld->brightness = LED_OFF;
> > + if (!strcmp(props->default_state, "on"))
> > + ld->brightness = LED_FULL;
>
> Max brightness is not always == LED_FULL these days.

I took another look at this and changed this to:

if (!strcmp(props->default_state, "on")) {
if (!ld->max_brightness)
ld->brightness = LED_FULL;
else
ld->brightness = ld->max_brightness;
}

I hope this is what you were suggesting. I'll send the v8 (hopefully)
soon(ish).

Best Regards
Matti
\
 
 \ /
  Last update: 2019-12-30 08:37    [W:0.215 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site