[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201217225942.GA8241@amd>
Date: Thu, 17 Dec 2020 23:59:43 +0100
From: Pavel Machek <pavel@....cz>
To: David Laight <David.Laight@...LAB.COM>
Cc: 'Marek Behun' <marek.behun@....cz>,
Abanoub Sameh <abanoubsameh8@...il.com>,
"linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Abanoub Sameh <abanoubsameh@...tonmail.com>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] leds: led-core: Get rid of enum led_brightness
Hi!
> > On Fri, 11 Dec 2020 03:48:40 +0200
> > Abanoub Sameh <abanoubsameh8@...il.com> wrote:
> >
> > > This gets rid of enum led_brightness in the main led files,
> > > because it is deprecated, and an int can be used instead,
> > > or maybe even a uint8_t since it only goes up to 255.
> > > Next we can also patch the other files to get rid of it completely.
> >
> > 1. unsigned int should be used IMO
> > - using int may force all implementers to check for negative value
> > and return -EINVAL, which is stupid
> > - some LED controllers may offer more than 8bit brightness value, so
> > no uint8_t
>
> More than 8 bits would be good.
> While not really relevant for actual 'brightness' it allows
> for 'strange' things be encoded in the brightness field.
I have headlamp which can do 0.1lumens to 750lumens. Some go down to
0.01 lumens. More than 8 bits definitely makes sense.
Display backlights also need great ranges.
> While extra parameters could be added, they are only really usable
> by code that knows they are present.
> So encoding in the 'brightness' sort of makes sense.
No.
Pavel
--
http://www.livejournal.com/~pavelmachek
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists