devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Vincent Knecht <vincent.knecht@mailoo.org>
Cc: Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Linux LED Subsystem <linux-leds@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org,
	"H. Nikolaus Schaller" <hns@goldelico.com>
Subject: Re: [PATCH v3 6/6] leds: is31fl319x: Add support for is31fl319{0,1,3} chips
Date: Tue, 5 Jul 2022 20:56:16 +0200	[thread overview]
Message-ID: <CAHp75VfrROx1oM54x1Bc8+zLkPi6-ivxPtFS2ECyPPLKsYFd1g@mail.gmail.com> (raw)
In-Reply-To: <20220705163136.2278662-7-vincent.knecht@mailoo.org>

On Tue, Jul 5, 2022 at 6:32 PM Vincent Knecht <vincent.knecht@mailoo.org> wrote:
>
> Set specific chipset structs values for is31fl319{0,1,3}
> so that those chips can actually work.
> Datasheets:
> https://lumissil.com/assets/pdf/core/IS31FL3190_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3191_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3193_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3196_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3199_DS.pdf

...

Two comments as per previous patch reviews.

...

> +       struct is31fl319x_led *led = container_of(cdev, struct is31fl319x_led,
> +                                                 cdev);

One line?

...

> +               ret = regmap_read(is31->regmap, IS31FL3190_PWM(i), &pwm_value);

> +               dev_dbg(&is31->client->dev, "%s read %d: ret=%d: %d\n",
> +                       __func__, i, ret, pwm_value);

regmap has tracepoints Do you need to duplicate it with slow printk()?

...

> +static inline int is31fl3190_microamp_to_cs(struct device *dev, u32 microamp)
> +{
> +       switch (microamp) {
> +       case 5000:
> +               return IS31FL3190_CURRENT_5_mA;
> +       case 10000:
> +               return IS31FL3190_CURRENT_10_mA;
> +       case 17500:
> +               return IS31FL3190_CURRENT_17dot5_mA;
> +       case 30000:
> +               return IS31FL3190_CURRENT_30_mA;
> +       case 42000:
> +               return IS31FL3190_CURRENT_42_mA;
> +       default:
> +               dev_warn(dev, "Unsupported current value: %d, using 5000 µA!\n", microamp);
> +       }
> +
> +       return IS31FL3190_CURRENT_5_mA;

It's more consistent to return directly from the default case.

> +}

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2022-07-05 18:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 16:31 [PATCH v3 0/6] leds: Fix/Add is31fl319{0,1,3} support Vincent Knecht
2022-07-05 16:31 ` [PATCH v3 1/6] dt-bindings: leds: Convert is31fl319x to dtschema Vincent Knecht
2022-07-05 16:31 ` [PATCH v3 2/6] dt-bindings: leds: is31fl319x: Document variants specificities Vincent Knecht
2022-07-05 16:31 ` [PATCH v3 3/6] leds: is31fl319x: Add missing si-en compatibles Vincent Knecht
2022-07-05 16:31 ` [PATCH v3 4/6] leds: is31fl319x: Use non-wildcard names for vars, structs and defines Vincent Knecht
2022-07-05 18:47   ` Andy Shevchenko
2022-07-05 16:31 ` [PATCH v3 5/6] leds: is31fl319x: Move chipset-specific values in chipdef struct Vincent Knecht
2022-07-05 18:51   ` Andy Shevchenko
2022-07-05 16:31 ` [PATCH v3 6/6] leds: is31fl319x: Add support for is31fl319{0,1,3} chips Vincent Knecht
2022-07-05 18:56   ` Andy Shevchenko [this message]
2022-07-05 18:57 ` [PATCH v3 0/6] leds: Fix/Add is31fl319{0,1,3} support Andy Shevchenko
2022-07-09  9:51   ` Vincent Knecht
2022-07-11 21:39     ` Andy Shevchenko
2022-07-11 21:40       ` Andy Shevchenko

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=CAHp75VfrROx1oM54x1Bc8+zLkPi6-ivxPtFS2ECyPPLKsYFd1g@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hns@goldelico.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=vincent.knecht@mailoo.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).