[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160708205342.GT5934@zver>
Date: Fri, 8 Jul 2016 23:53:42 +0300
From: Andrey Utkin <andrey_utkin@...tmail.com>
To: "H. Nikolaus Schaller" <hns@...delico.com>
Cc: Rob Herring <robh+dt@...nel.org>, Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Richard Purdie <rpurdie@...ys.net>,
Jacek Anaszewski <j.anaszewski@...sung.com>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org, kernel@...a-handheld.com,
marek@...delico.com, letux-kernel@...nphoenux.org
Subject: Re: [PATCH v3 1/2] drivers: led: is31fl319x: 1/3/6/9-channel light
effect led driver
On Fri, Jul 08, 2016 at 09:49:37PM +0200, H. Nikolaus Schaller wrote:
> +static int is31fl319x_microamp_to_cs(u32 microamp)
> +{
> + switch (microamp) {
> + default:
> + WARN(1, "Invalid microamp setting");
> + case 20000: return 0;
> + case 15000: return 1;
> + case 10000: return 2;
> + case 5000: return 3;
> + case 40000: return 4;
> + case 35000: return 5;
> + case 30000: return 6;
> + case 25000: return 7;
> + }
> +}
> +
...
> + regmap_write(is31->regmap, IS31FL319X_CONFIG2,
> + is31fl319x_microamp_to_cs(aggregated_led_microamp) << 4 |
> + is31->audio_gain_db / 3);
As I figured out by now, previous implementation of current setting (by
inline expression) was fine, this new one is just more obvious. So if
you wonder why it was replaced, I can say - "because of
misunderstanding". So switching back to that implementation is possible.
> +static struct i2c_driver is31fl319x_driver = {
> + .driver = {
> + .name = "leds-is31fl319x",
> + .of_match_table = of_match_ptr(of_is31fl319x_leds_match),
Broken alignment :/ If this gets another iteration, i'll fix it.
Powered by blists - more mailing lists