[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210325132647.3004fd73@thinkpad>
Date: Thu, 25 Mar 2021 13:26:47 +0100
From: Marek Behun <marek.behun@....cz>
To: Hermes Zhang <Hermes.Zhang@...s.com>
Cc: "pavel@....cz" <pavel@....cz>, "dmurphy@...com" <dmurphy@...com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lkml@...s.com" <lkml@...s.com>, kernel <kernel@...s.com>
Subject: Re: [PATCH 1/2] leds: leds-multi-gpio: Add multiple GPIOs LED
driver
On Thu, 25 Mar 2021 06:04:43 +0000
Hermes Zhang <Hermes.Zhang@...s.com> wrote:
> > LED_FULL / LED_OFF are deprecated, don't use them.
>
> Then could I use just 0 (instead LED_OFF) and led_cdev->max_brightness
>
> (instead of LED_FULL) here? The idea here is map the states defined in dts
>
> to the full brightness range.
Yes, you can and should use 0 insted of LED_OFF.
> > + priv->cdev.max_brightness = LED_FULL;
> > ???? max_brightness is not 255 (= LED_FULL). max_brightness must be
> > derived from the led-states property.
>
> Yeah, I will fix this. the max-brightness should for the whole LED,
> right? So
>
> it will at same level with led-states.
max_brightness should be (the number of states - 1). I.e. if you have 4
gpios and the LED supports full 2^4 = 16 states, max brightness should
be 15.
Marek
Powered by blists - more mailing lists