linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Matti Vaittinen <matti.vaittinen@linux.dev>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org, Sebastian Reichel <sre@kernel.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-clk@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	linux-leds@vger.kernel.org, Pavel Machek <pavel@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org,
	Andreas Kemnade <andreas@kemnade.info>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-rtc@vger.kernel.org,
	Lee Jones <lee@kernel.org>, Stephen Boyd <sboyd@kernel.org>
Subject: Re: [PATCH v4 04/16] dt-bindings: power: supply: BD72720 managed battery
Date: Mon, 17 Nov 2025 09:23:41 -0600	[thread overview]
Message-ID: <20251117152341.GA1944698-robh@kernel.org> (raw)
In-Reply-To: <32303b95-3fd5-44c4-bb7d-e2957a6064fc@gmail.com>

On Mon, Nov 17, 2025 at 10:12:01AM +0200, Matti Vaittinen wrote:
> On 14/11/2025 18:39, Rob Herring wrote:
> > On Fri, Nov 14, 2025 at 11:04:27AM +0200, Matti Vaittinen wrote:
> > > On 13/11/2025 12:53, Rob Herring (Arm) wrote:
> > > > 
> > > > On Thu, 13 Nov 2025 10:52:19 +0200, Matti Vaittinen wrote:
> > > > > From: Matti Vaittinen <mazziesaccount@gmail.com>
> 
> //snip
> 
> > > 
> > > So, as far as I understand, the only viable options are expanding the
> > > existing battery.yaml with these properties (which I hoped to avoid, see
> > > below)
> > > 
> > > > > The right place for them is the battery node, which is described by the
> > > > > generic "battery.yaml". I was not comfortable with adding these
> > > > > properties to the generic battery.yaml because they are:
> > > > >     - Meaningful only for those charger drivers which have the VDR
> > > > >       algorithm implemented. (And even though the algorithm is not charger
> > > > >       specific, AFAICS, it is currently only used by some ROHM PMIC
> > > > >       drivers).
> > > > >     - Technique of measuring the VDR tables for a battery is not widely
> > > > >       known. AFAICS, only folks at ROHM are measuring those for some
> > > > >       customer products. We do have those tables available for some of the
> > > > >       products though (Kobo?).
> > > 
> > > or, to add new compatible for the "vdr-battery".
> > > AFAICS, adding new compatible would require us to wither duplicate the used
> > > properties from battery.yaml here (as battery.yaml mandates the
> > > "simple-battery" - compatible) - or to split the battery.yaml in two files,
> > > one containing the generic properties, other containing the "simple-battery"
> > > -compatible and referencing the generic one. Then the "vdr-battery" could
> > > also reference the generic one.
> > > 
> > > Any suggestions for the next path to follow?
> > 
> > Probably the latter option. You could do the former and make the new
> > properties conditional on the "vdr-battery" compatible. That's fine with
> > small differences, but gets messy as there are more properties and
> > variations.
> > 
> > But is "VDR" a type of battery though? Is there a certain type/chemistry
> > of battery we should be describing where VDR is applicable?
> 
> No. Not that I know. My understanding is that the "VDR (voltage drop rate)"
> refers to measured voltage drop-rates under certain conditions - which can
> be used to (more accurately) estimate the remaining capacity when battery is
> nearly depleted. As far as I know, this is only used with Lithium-ion
> batteries (I am not at all sure of this) - but I _assume_ the technique
> could be applied to other type of batteries as well.
> 
> > I don't
> > think it scales well if we define battery compatibles for every
> > variation of charger algorithm. Honestly I don't mind just adding 1
> > property. I care more if we allow undocumented properties than
> > allowing documented but invalid for the platform properties.
> 
> I see. The "VDR" stuff is really tightly bound to the fuel-gauging
> algorithm. It is measured characteristics of the battery - but those values
> are only usable by the "VDR" algorithm. I don't really have a good insight
> in the amount of fuel-gauging algorithm related properties suggested to be
> added during the years - but don't think there have been that many of them.
> So, I am not that worried about adding the compatible. On the other hand,
> there is no technical reason (other than adding properties which are unused
> on many platforms) why not to add the vdr tables in the static-battey node
> without adding own compatible. And, reading reply from Andreas (I'll copy it
> here to answer it in same mail)
> 
> /// Below text is form Andreas:
> > just keep in mind, that several kobo devices have one pmic in one board
> > revision and another one in the other (e.g. Kobo Nia rev A vs rev C).
> > But probably the same battery. So if the "vdr-battery" is a compatible
> > just to allow a more properties,
> > then "simple-battery" should be allowed as fallback.
> 
> I didn't know Kobos use multiple chargers. Thanks Andreas! So, in that
> sense, adding the "vdr" tables in static-battery node, without new
> compatible, would maybe be simplest solution. Then the charger(s)
> (fuel-gauge(s)) which implement VDR algorithm, can pick the tables while
> those chargers which don't implement the VDR will just ignore these tables.
> 
> > When it
> > becomes 10, 20, 30 properties, then I might start to care.
> 
> For VDR there are only:
> 
> rohm,voltage-vdr-thresh-microvolt,

So "voltage voltage drop rate"? And '-microvolt' says this is voltage 
too. :)

> rohm,volt-drop-soc-bp,
> rohm,volt-drop-temperatures-millicelsius
> 
> and
> 
> patternProperties:
>   '^rohm,volt-drop-[0-9]-microvolt':
> 
> So, from the binding point of view (.yaml), it's not _that_ lot. In the .dts
> there will be quite some noise as the tables have several values.
> 
> 
> > If that
> > happens, either we are doing a poor job of generically describing
> > battery parameters or chargers and batteries are tightly coupled and
> > can't be described independently.
> 
> I am under impression that chargers tend to be pretty flexible, and they can
> be configured to work with many different batteries by altering the charging
> profiles. Most of the battery properties (like and charging phases [like
> pre, CC, CV], their limits, currents and voltages etc) are very generally
> usable. So, large subset of charging functionality can be handled with
> standard properties. I believe it is only the fuel-gauging where things get
> more hairy.
> 
> I did prepare a series which does the split and adds new compatible for the
> 'rohm,vdr-battery'. (The power-supply class is not yet modified in the
> series, but we would probably want to modify the battery-info getters to
> also accept the 'rohm,vdr-battery' -compatible.)

I don't think that's the right direction. It's not a Rohm battery.

> I wonder if I should actually prepare also a series where these properties
> are just placed in the existing static battery node without adding new
> compatible. That way it would be easier to see which way is better.

That seems like the right thing to do here. 

The main question for me is whether these should even be Rohm specific? 
That would probably require a 2nd user to answer for sure. 


> If I do that, should I only spin these bindings as RFC to avoid the
> unnecessary noise?

Only if you think something is not complete and/or the patches should 
not be applied.

Rob

  reply	other threads:[~2025-11-17 15:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13  8:51 [PATCH v4 00/16] Support ROHM BD72720 PMIC Matti Vaittinen
2025-11-13  8:51 ` [PATCH v4 01/16] dt-bindings: regulator: ROHM BD72720 Matti Vaittinen
2025-11-13 10:53   ` Rob Herring (Arm)
2025-11-14 16:22   ` Rob Herring (Arm)
2025-11-13  8:51 ` [PATCH v4 02/16] dt-bindings: battery: Clarify trickle-charge Matti Vaittinen
2025-11-13  8:52 ` [PATCH v4 03/16] dt-bindings: battery: Add trickle-charge upper limit Matti Vaittinen
2025-11-13  8:52 ` [PATCH v4 04/16] dt-bindings: power: supply: BD72720 managed battery Matti Vaittinen
2025-11-13 10:53   ` Rob Herring (Arm)
2025-11-14  9:04     ` Matti Vaittinen
2025-11-14 16:39       ` Rob Herring
2025-11-14 17:40         ` Andreas Kemnade
2025-11-17  8:12         ` Matti Vaittinen
2025-11-17 15:23           ` Rob Herring [this message]
2025-11-17 15:48             ` Matti Vaittinen
2025-11-13  8:52 ` [PATCH v4 05/16] dt-bindings: mfd: ROHM BD72720 Matti Vaittinen
2025-11-15 11:31   ` Krzysztof Kozlowski
2025-11-18 23:06   ` Linus Walleij
2025-11-13  8:52 ` [PATCH v4 06/16] dt-bindings: leds: bd72720: Add BD72720 Matti Vaittinen
2025-11-13  8:53 ` [PATCH v4 07/16] mfd: rohm-bd71828: Use regmap_reg_range() Matti Vaittinen
2025-11-13  8:53 ` [PATCH v4 08/16] mfd: bd71828: Support ROHM BD72720 Matti Vaittinen
2025-11-13  8:54 ` [PATCH v4 09/16] regulator: bd71828: rename IC specific entities Matti Vaittinen
2025-11-13  8:54 ` [PATCH v4 10/16] regulator: bd71828: Support ROHM BD72720 Matti Vaittinen
2025-11-13  8:54 ` [PATCH v4 11/16] gpio: Support ROHM BD72720 gpios Matti Vaittinen
2025-11-13  8:55 ` [PATCH v4 12/16] clk: clk-bd718x7: Support BD72720 clk gate Matti Vaittinen
2025-11-14  3:53   ` Stephen Boyd
2025-11-13  8:55 ` [PATCH v4 13/16] rtc: bd70528: Support BD72720 rtc Matti Vaittinen
2025-11-13  8:55 ` [PATCH v4 14/16] power: supply: bd71828: Support wider register addresses Matti Vaittinen
2025-11-14 11:15   ` Andreas Kemnade
2025-11-14 13:22     ` Matti Vaittinen
2025-11-13  8:55 ` [PATCH v4 15/16] power: supply: bd71828-power: Support ROHM BD72720 Matti Vaittinen
2025-11-13  8:56 ` [PATCH v4 16/16] MAINTAINERS: Add ROHM BD72720 PMIC Matti Vaittinen

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=20251117152341.GA1944698-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andreas@kemnade.info \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=matti.vaittinen@linux.dev \
    --cc=mazziesaccount@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=pavel@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sre@kernel.org \
    /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).