From: Pavel Machek <pavel@ucw.cz>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Marek Behun' <marek.behun@nic.cz>,
Abanoub Sameh <abanoubsameh8@gmail.com>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Abanoub Sameh <abanoubsameh@protonmail.com>,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] leds: led-core: Get rid of enum led_brightness
Date: Thu, 17 Dec 2020 23:59:43 +0100 [thread overview]
Message-ID: <20201217225942.GA8241@amd> (raw)
In-Reply-To: <2ae41868b2604a489927b5903529afb4@AcuMS.aculab.com>
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
Hi!
> > On Fri, 11 Dec 2020 03:48:40 +0200
> > Abanoub Sameh <abanoubsameh8@gmail.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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2020-12-17 23:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 1:48 [PATCH] leds: led-core: Get rid of enum led_brightness Abanoub Sameh
2020-12-11 12:56 ` Marek Behun
2020-12-11 14:08 ` David Laight
2020-12-11 18:31 ` Marek Behun
2020-12-17 22:59 ` Pavel Machek [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-12-11 20:42 Abanoub Sameh
2021-02-19 10:36 ` Pavel Machek
2020-12-10 13:49 Abanoub Sameh
2020-12-10 20:03 ` kernel test robot
2020-12-10 20:03 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201217225942.GA8241@amd \
--to=pavel@ucw.cz \
--cc=David.Laight@ACULAB.COM \
--cc=abanoubsameh8@gmail.com \
--cc=abanoubsameh@protonmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marek.behun@nic.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.