From: "Paul Louvel" <paul.louvel@bootlin.com>
To: "Mark Brown" <broonie@kernel.org>,
"Paul Louvel" <paul.louvel@bootlin.com>
Cc: "Liam Girdwood" <lgirdwood@gmail.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Herve Codina" <herve.codina@bootlin.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>
Subject: Re: [PATCH v3 3/3] regulator: Add TI LM51772 support
Date: Mon, 02 Nov 2026 13:23:02 +0100 [thread overview]
Message-ID: <DMKPZZNSDY1O.3DILD6GVHK3RO@bootlin.com> (raw)
In-Reply-To: <179337726255.87968.9906404525377602371.b4-review@b4>
Hi Mark,
On Fri Oct 30, 2026 at 5:21 PM CET, Mark Brown wrote:
>> Add driver for the TI LM51772 buck-boost voltage regulator.
>
>> @@ -0,0 +1,903 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * TI LM51772 I2C regulator driver
>> + *
>> + * Datasheet: SNVSC22D (September 2025)
>> + *
>> + * Copyright (c) 2026 Bootlin
>> + */
>
> Please make the entire comment block a C++ one so things look more
> intentional.
>
>> +static int lm51772_irq_map_event(int irq, struct regulator_irq_data *rid, unsigned long *dev_mask)
>> +{
>
>> + ret = regmap_read(regmap, LM51772_REG_CLEAR_FAULTS, ®);
>> + if (ret)
>> + return REGULATOR_FAILED_RETRY;
>
> This register appears to be clear on read so it should be marked as
> precious, otherwise debugfs will eat notifications.
>
>> +/*
>> + * For < 24V, voltages are set in 10mV monotonous steps.
>> + * For >= 24V, voltages are set in 20mV monotonous steps.
>> + */
>> +static const struct linear_range lm51772_voltage_ranges[] = {
>> + REGULATOR_LINEAR_RANGE(LM51772_DIV10_MIN_UV, 0, 99, 0),
>> + REGULATOR_LINEAR_RANGE(LM51772_DIV10_MIN_UV, 100, 2399, LM51772_DIV10_STEP_UV),
>
> Looks like this ought to cover 2400 too since there's overlap between
> the two ranges? If we don't have it then the driver will get upset if
> it finds the hardware with that configuration when it starts.
>
>> + .active_discharge_mask = LM51772_FORCE_DISCH,
>> + .active_discharge_on = FIELD_PREP_CONST(LM51772_FORCE_DISCH, 1),
>> + .active_discharge_off = FIELD_PREP_CONST(LM51772_FORCE_DISCH, 0),
>
> It looks like this is an always on load on the output rather than
> something only enabled when the regulator has been disabled so we'll end
> up with an extra power drain for no reason. Possibly we should have
> core support for hardware that needs such manual management, though the
> datasheet suggests DICHARG_CONFIG0/1 might be more appropriate for what
> the API is looking for here?
Yes indeed. I see no reason for the DISCHARGE_CONFIG0/1 to be disabled. At
first, I thought that the FORCE_DISH was necessary to get the discharge on DVS
ramp down.
By manual management, do you mean selecting between those three configuration
(force discharge, discharge only when disabled, disacharge only when disabled
and until a certain threshold) ?
Thanks.
Best regards,
--
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-11-02 12:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 14:44 [PATCH v3 0/3] Add TI LM51772 buck-boost voltage regulator Paul Louvel
2026-10-30 14:44 ` [PATCH v3 1/3] regulator: dt-bindings: Add TI LM51772 support Paul Louvel
2026-10-30 14:44 ` [PATCH v3 2/3] regulator: Support regulators where the voltage selector spans two registers Paul Louvel
2026-10-30 16:21 ` Mark Brown
2026-10-30 14:44 ` [PATCH v3 3/3] regulator: Add TI LM51772 support Paul Louvel
2026-10-30 16:21 ` Mark Brown
2026-11-02 12:23 ` Paul Louvel [this message]
2026-11-02 17:09 ` Mark Brown
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=DMKPZZNSDY1O.3DILD6GVHK3RO@bootlin.com \
--to=paul.louvel@bootlin.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=herve.codina@bootlin.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=robh@kernel.org \
--cc=thomas.petazzoni@bootlin.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
all inboxes | Powered by JetHome®