devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Utkin <andrey_utkin@fastmail.com>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <j.anaszewski@samsung.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-leds@vger.kernel.org, kernel@pyra-handheld.com,
	marek@goldelico.com, letux-kernel@openphoenux.org
Subject: Re: [PATCH v3 1/2] drivers: led: is31fl319x: 1/3/6/9-channel light effect led driver
Date: Fri, 8 Jul 2016 23:53:42 +0300	[thread overview]
Message-ID: <20160708205342.GT5934@zver> (raw)
In-Reply-To: <524f16ecba240bacf57924f43ec38404cfdcde8f.1468007377.git.hns@goldelico.com>

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.

  reply	other threads:[~2016-07-08 20:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 19:49 [PATCH v3 0/2] driver: leds: is31fl319x dimmable LED driver H. Nikolaus Schaller
2016-07-08 19:49 ` [PATCH v3 1/2] drivers: led: is31fl319x: 1/3/6/9-channel light effect led driver H. Nikolaus Schaller
2016-07-08 20:53   ` Andrey Utkin [this message]
     [not found]   ` <524f16ecba240bacf57924f43ec38404cfdcde8f.1468007377.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-07-12 20:14     ` Jacek Anaszewski
2016-07-13  6:09       ` H. Nikolaus Schaller
2016-07-13  7:45         ` Jacek Anaszewski
2016-07-13  8:52           ` H. Nikolaus Schaller
2016-07-13  9:26             ` Jacek Anaszewski
2016-07-13  9:34               ` H. Nikolaus Schaller
2016-07-15  8:08       ` H. Nikolaus Schaller
2016-07-19  6:59         ` Jacek Anaszewski
     [not found] ` <cover.1468007377.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-07-08 19:49   ` [PATCH v3 2/2] Bindings documentation for ISSI is31fl319x driver H. Nikolaus Schaller
     [not found]     ` <44b0cd33fc831d55dd7d012c4d4554ed9e2d70f4.1468007377.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-07-12 20:14       ` Jacek Anaszewski
2016-07-16  0:18     ` Rob Herring

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=20160708205342.GT5934@zver \
    --to=andrey_utkin@fastmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=hns@goldelico.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=j.anaszewski@samsung.com \
    --cc=kernel@pyra-handheld.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=marek@goldelico.com \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).