linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add support for the LTM8054 voltage regulator
@ 2025-09-16 10:24 Romain Gantois
  2025-09-16 10:24 ` [PATCH 1/4] regulator: dt-bindings: Add Linear Technology LTM8054 regulator Romain Gantois
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Romain Gantois @ 2025-09-16 10:24 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko
  Cc: Thomas Petazzoni, linux-kernel, devicetree, linux-iio,
	Romain Gantois

Hello everyone,

This series adds initial support of the Linear Technology LTM8054 voltage
regulator. The driver supports a fixed voltage and a tunable output current
limit using a DAC-controlled pin.

I'd say that the only unusual part of this series is the usage of the IIO
consumer API in a regulator driver. I think this makes sense here, since
the regulator driver has to access a DAC to read/set the output current
limit.

Since the regulator driver writes microvolts and the IIO consumer API takes
millivolts, the reads and writes to the CTL DAC have to be scaled by a
factor of 1000. Scaled reads are already supported in IIO, but scaled
writes are not, which is why I've implemented them in patch 2/4.

Please let me know what you think.

Thanks,

Romain

Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
---
Romain Gantois (4):
      regulator: dt-bindings: Add Linear Technology LTM8054 regulator
      iio: add processed write API
      regulator: Support the LTM8054 voltage regulator
      regulator: ltm8054: Support output current limit control

 .../bindings/regulator/lltc,ltm8054.yaml           |  77 +++++++
 MAINTAINERS                                        |   6 +
 drivers/iio/inkern.c                               |  99 +++++++++
 drivers/regulator/Kconfig                          |   9 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/ltm8054-regulator.c              | 229 +++++++++++++++++++++
 include/linux/iio/consumer.h                       |  17 ++
 7 files changed, 438 insertions(+)
---
base-commit: f87c2b34768828c4ff535ba7d50dd938838caab9
change-id: 20250728-ltm8054-driver-11cfa4741065

Best regards,
-- 
Romain Gantois <romain.gantois@bootlin.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] regulator: ltm8054: Support output current limit control
@ 2025-10-18 19:30 Andy Shevchenko
  0 siblings, 0 replies; 27+ messages in thread
From: Andy Shevchenko @ 2025-10-18 19:30 UTC (permalink / raw)
  To: Romain Gantois
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Thomas Petazzoni, linux-kernel, devicetree,
	linux-iio

On Thu, Sep 25, 2025 at 09:54:19AM +0200, Romain Gantois wrote:
> On Tuesday, 16 September 2025 16:27:25 CEST Romain Gantois wrote:
> > On Tuesday, 16 September 2025 15:19:16 CEST Andy Shevchenko wrote:
> > > On Tue, Sep 16, 2025 at 12:24:09PM +0200, Romain Gantois wrote:
...
> > > > CTL pin voltage */ +	vdac_uV = (u64)min_uA * LTM8054_MAX_CTL_V;
> > > > +	do_div(vdac_uV, priv->max_uA);
> > > > +
> > > > +	dev_dbg(&rdev->dev,
> > > > +		"Setting current limit to %duA, CTL pin to %duV\n", min_uA,
> > > > (int)vdac_uV);
> > > 
> > > Why casting?
> > 
> > This one is indeed unnecessary.
> 
> My mistake, this cast is required to avoid a compiler warning;

THen provide a proper specifier instead. Casting in printf() is in 99.9% cases
just a pure mistake.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2025-10-18 19:30 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 10:24 [PATCH 0/4] Add support for the LTM8054 voltage regulator Romain Gantois
2025-09-16 10:24 ` [PATCH 1/4] regulator: dt-bindings: Add Linear Technology LTM8054 regulator Romain Gantois
2025-09-16 13:25   ` Rob Herring (Arm)
2025-09-16 19:24   ` David Lechner
2025-09-17 15:51     ` Romain Gantois
2025-09-18  7:30       ` Romain Gantois
2025-09-16 10:24 ` [PATCH 2/4] iio: add processed write API Romain Gantois
2025-09-16 11:19   ` Mark Brown
2025-09-16 13:00     ` Romain Gantois
2025-09-16 13:03   ` Andy Shevchenko
2025-09-16 19:23   ` David Lechner
2025-09-17 15:46     ` Romain Gantois
2025-09-20 11:56       ` Jonathan Cameron
2025-09-16 10:24 ` [PATCH 3/4] regulator: Support the LTM8054 voltage regulator Romain Gantois
2025-09-16 13:12   ` Andy Shevchenko
2025-09-16 13:20     ` Andy Shevchenko
2025-09-16 14:17     ` Romain Gantois
2025-09-18  9:31       ` Romain Gantois
2025-09-18 19:17         ` Andy Shevchenko
2025-09-19  8:19           ` Romain Gantois
2025-09-16 10:24 ` [PATCH 4/4] regulator: ltm8054: Support output current limit control Romain Gantois
2025-09-16 13:19   ` Andy Shevchenko
2025-09-16 14:27     ` Romain Gantois
2025-09-17  7:02       ` Andy Shevchenko
2025-09-17  7:03         ` Andy Shevchenko
2025-09-25  7:54       ` Romain Gantois
  -- strict thread matches above, loose matches on Subject: below --
2025-10-18 19:30 Andy Shevchenko

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).