lkml.org 
[lkml]   [2021]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@axis.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

\
 
 \ /
  Last update: 2021-03-25 13:28    [W:0.140 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site