[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8359b8365f6c86fe4acb9c35c2c6be55091b45a3.camel@fi.rohmeurope.com>
Date: Mon, 30 Dec 2019 07:36:17 +0000
From: "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To: "pavel@....cz" <pavel@....cz>
CC: "linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
"dmurphy@...com" <dmurphy@...com>,
"linux-rtc@...r.kernel.org" <linux-rtc@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mturquette@...libre.com" <mturquette@...libre.com>,
"mazziesaccount@...il.com" <mazziesaccount@...il.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"jacek.anaszewski@...il.com" <jacek.anaszewski@...il.com>,
"a.zummo@...ertech.it" <a.zummo@...ertech.it>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"mark.rutland@....com" <mark.rutland@....com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"bgolaszewski@...libre.com" <bgolaszewski@...libre.com>,
"linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
"lee.jones@...aro.org" <lee.jones@...aro.org>,
"sboyd@...nel.org" <sboyd@...nel.org>,
"broonie@...nel.org" <broonie@...nel.org>
Subject: Re: [PATCH v7 11/12] leds: Add common LED binding parsing support
to LED class/core
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
Powered by blists - more mailing lists