From: Eddie James <eajames@linux.ibm.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Joel Stanley <joel@jms.id.au>, Pavel Machek <pavel@ucw.cz>,
Linux LED Subsystem <linux-leds@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] leds: pca955x: Add HW blink support
Date: Mon, 11 Apr 2022 11:06:35 -0500 [thread overview]
Message-ID: <fe69f04f-c356-b532-e82b-0b9b99e25c86@linux.ibm.com> (raw)
In-Reply-To: <CAHp75VfcmhGitd6_6mDVG6_eE02sX2B3_iqZxeiX3iFDkmPShg@mail.gmail.com>
On 4/8/22 06:19, Andy Shevchenko wrote:
> On Thu, Apr 7, 2022 at 10:43 PM Eddie James <eajames@linux.ibm.com> wrote:
>> Support blinking using the PCA955x chip. Use PWM0 for blinking
>> instead of LED_HALF brightness. Since there is only one frequency
>> and brightness register for any blinking LED, track the blink state
>> of each LED and only support one HW blinking frequency. If another
>> frequency is requested, fallback to software blinking.
> ...
>
>> +#define PCA955X_BLINK_DEFAULT 1000
> What's the unit of this number?
milliseconds, I'll change the name to reflect that.
>
> ...
>
>> * Write to frequency prescaler register, used to program the
>> - * period of the PWM output. period = (PSCx + 1) / 38
>> + * period of the PWM output. period = (PSCx + 1) / <38 or 44, chip dependent>
> Using <> in formulas a bit confusing, what about
>
> * period of the PWM output. period = (PSCx + 1) / coeff
> * where for ... chips coeff = 38, for ... chips coeff = 44.
>
> ?
Ack.
>
> ...
>
>> + dev_err(&pca955x->client->dev, "%s: reg 0x%x, err %d\n",
>> + __func__, n, ret);
> Can be indented better. But I would rather see regmap, where this kind
> of debugging is for free and already present in the regmap core/.
Agree, but perhaps for a future enhancement?
>
> ...
>
>> +static u8 pca955x_period_to_psc(struct pca955x *pca955x, unsigned long p)
>> +{
>> + p *= (unsigned long)pca955x->chipdef->blink_div;
> Why casting?
Ack, and all the rest. Will get a v2 up.
Thanks Andy.
Eddie
prev parent reply other threads:[~2022-04-11 16:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 18:39 [PATCH v2 0/2] leds: pca955x: Add HW blink support Eddie James
2022-04-07 18:39 ` [PATCH v2 1/2] leds: pca955x: Clean up and optimize Eddie James
2022-04-08 11:11 ` Andy Shevchenko
2022-04-11 15:17 ` Eddie James
2022-04-07 18:39 ` [PATCH v2 2/2] leds: pca955x: Add HW blink support Eddie James
2022-04-08 11:19 ` Andy Shevchenko
2022-04-11 16:06 ` Eddie James [this message]
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=fe69f04f-c356-b532-e82b-0b9b99e25c86@linux.ibm.com \
--to=eajames@linux.ibm.com \
--cc=andy.shevchenko@gmail.com \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=pavel@ucw.cz \
/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).