[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANhJrGN8avK7mehqVDHVCjBzoG3RU4CykHEaFdQqt40_LjSh1A@mail.gmail.com>
Date: Thu, 28 Apr 2022 14:50:53 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: cy_huang <u0084500@...il.com>
Cc: Pavel Machek <pavel@....cz>,
Matthias Brugger <matthias.bgg@...il.com>,
ChiYuan Huang <cy_huang@...htek.com>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
Gene Chen <gene_chen@...htek.com>, linux-leds@...r.kernel.org,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/4] leds: flash: mt6360: Add mt6360 isnk channel hardwre
breath mode support
Hi ChiYuan!
On Thu, Apr 28, 2022 at 1:03 PM cy_huang <u0084500@...il.com> wrote:
> From: ChiYuan Huang <cy_huang@...htek.com>
>
> Add mt6360 isnk channel hardware breath mode support.
>
> Signed-off-by: ChiYuan Huang <cy_huang@...htek.com>
>
> +static int mt6360_gen_breath_reg_config(struct led_pattern *pattern, u32 len,
> + u8 *vals, int val_len)
> +{
> + static const struct linear_range tranges[MT6360_ILED_RANGE_MAX] = {
> + { 125, 0, 15, 250 }, /* tr/f12 and ton, unit: millisecond */
> + { 250, 0, 15, 500 }, /* toff, unit: millisecond */
> + };
It's nice to see you are using the linear_ranges helpers here! Just a
minor remark - do you think you could use field names in linear_ranges
initializations? That would make it less likely the driver breaks if
someone changes the struct linear_range definition. Eg, use something
like:
static const struct linear_range tranges[MT6360_ILED_RANGE_MAX] = {
/* tr/f12 and ton, unit: millisecond */
{ .min = 125, .min_sel = 0, .max_sel = 15, .step = 250 },
/* toff, unit: millisecond */
{ .min = 250, .min_sel = 0, .max_sel = 15, .step = 500 },
};
Do you think that would work?
Best Regards
-- Matti
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
Discuss - Estimate - Plan - Report and finally accomplish this:
void do_work(int time) __attribute__ ((const));
Powered by blists - more mailing lists