From: Matti Vaittinen <mazziesaccount@gmail.com>
To: cy_huang <u0084500@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>,
Matthias Brugger <matthias.bgg@gmail.com>,
ChiYuan Huang <cy_huang@richtek.com>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Gene Chen <gene_chen@richtek.com>,
linux-leds@vger.kernel.org,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] leds: flash: mt6360: Add mt6360 isnk channel hardwre breath mode support
Date: Thu, 28 Apr 2022 14:50:53 +0300 [thread overview]
Message-ID: <CANhJrGN8avK7mehqVDHVCjBzoG3RU4CykHEaFdQqt40_LjSh1A@mail.gmail.com> (raw)
In-Reply-To: <1651138365-17362-5-git-send-email-u0084500@gmail.com>
Hi ChiYuan!
On Thu, Apr 28, 2022 at 1:03 PM cy_huang <u0084500@gmail.com> wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
>
> Add mt6360 isnk channel hardware breath mode support.
>
> Signed-off-by: ChiYuan Huang <cy_huang@richtek.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));
next prev parent reply other threads:[~2022-04-28 11:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 9:32 [PATCH 0/4] leds: flash: mt6360: Apply the fixes and hardware features cy_huang
2022-04-28 9:32 ` [PATCH 1/4] leds: flash: mt6360: Fix the wrong enable_reg in multicolor brightness set cy_huang
2022-04-28 9:32 ` [PATCH 2/4] leds: flash: mt6360: Remove unused dependency in Kconfig cy_huang
2022-04-28 9:32 ` [PATCH 3/4] leds: flash: mt6360: Add mt6360 isnk channel hardware timer dimming mode support cy_huang
2022-04-28 9:32 ` [PATCH 4/4] leds: flash: mt6360: Add mt6360 isnk channel hardwre breath " cy_huang
2022-04-28 11:50 ` Matti Vaittinen [this message]
2022-04-28 14:57 ` ChiYuan Huang
2022-06-14 7:36 ` [PATCH 0/4] leds: flash: mt6360: Apply the fixes and hardware features ChiYuan Huang
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=CANhJrGN8avK7mehqVDHVCjBzoG3RU4CykHEaFdQqt40_LjSh1A@mail.gmail.com \
--to=mazziesaccount@gmail.com \
--cc=cy_huang@richtek.com \
--cc=gene_chen@richtek.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=pavel@ucw.cz \
--cc=u0084500@gmail.com \
/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).