From: Andreas Kemnade <andreas@kemnade.info>
To: Rob Herring <robh@kernel.org>
Cc: Matti Vaittinen <mazziesaccount@gmail.com>,
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,
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: Fri, 14 Nov 2025 18:40:17 +0100 [thread overview]
Message-ID: <20251114184017.20d647da@kemnade.info> (raw)
In-Reply-To: <20251114163954.GA3399895-robh@kernel.org>
On Fri, 14 Nov 2025 10:39:54 -0600
Rob Herring <robh@kernel.org> 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>
> > > >
> > > > The BD72720 PMIC has a battery charger + coulomb counter block. These
> > > > can be used to manage charging of a lithium-ion battery and to do fuel
> > > > gauging.
> > > >
> > > > ROHM has developed a so called "zero-correction" -algorithm to improve
> > > > the fuel-gauging accuracy close to the point where battery is depleted.
> > > > This relies on battery specific "VDR" tables, which are measured from
> > > > the battery, and which describe the voltage drop rate. More thorough
> > > > explanation about the "zero correction" and "VDR" parameters is here:
> > > > https://lore.kernel.org/all/676253b9-ff69-7891-1f26-a8b5bb5a421b@fi.rohmeurope.com/
> > > >
> > > > Document the VDR zero-correction specific battery properties used by the
> > > > BD72720 and some other ROHM chargers.
> > > >
> > > > Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> > > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > > >
> > > > ---
> > > > NOTE:
> > > > Linus' rb-tag holds only if there's no further comments from Rob.
> > > >
> > > > Revision history:
> > > > v3 =>:
> > > > - No changes
> > > >
> > > > v2 => v3:
> > > > - Constrain VDR threshold voltage to 48V
> > > > - Use standard '-bp' -suffix for the rohm,volt-drop-soc
> > > >
> > > > RFCv1 => v2:
> > > > - Add units to rohm,volt-drop-soc (tenths of %)
> > > > - Give real temperatures matching the VDR tables, instead of vague
> > > > 'high', 'normal', 'low', 'very low'. (Add table of temperatures and
> > > > use number matching the right temperature index in the VDR table name).
> > > > - Fix typoed 'algorithm' in commit message.
> > > >
> > > > The parameters are describing the battery voltage drop rates - so they
> > > > are properties of the battery, not the charger. Thus they do not belong
> > > > in the charger node.
> > > >
> >
> > // snip
> >
> > > My bot found errors running 'make dt_binding_check' on your patch:
> > >
> > > yamllint warnings/errors:
> > >
> > > dtschema/dtc warnings/errors:
> > > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/supply/rohm,vdr-battery.example.dtb: battery (simple-battery): 'degrade-cycle-microamp-hours', 'rohm,volt-drop-0-microvolt', 'rohm,volt-drop-1-microvolt', 'rohm,volt-drop-2-microvolt', 'rohm,volt-drop-3-temp-microvolt', 'rohm,volt-drop-soc-bp', 'rohm,volt-drop-temperatures-millicelsius', 'rohm,voltage-vdr-thresh-microvolt' do not match any of the regexes: '^ocv-capacity-table-[0-9]+$', '^pinctrl-[0-9]+$'
> > > from schema $id: http://devicetree.org/schemas/power/supply/battery.yaml
> > >
> >
> > Odd. I am pretty sure I didn't see this when I ran the make
> > dt_binding_check. Not 100% sure what happened there. I get this error now
> > though when including all the bindings to the check.
> >
> > Do I get this right - these errors result from the properties used in
> > example not being included in the battery.yaml? So, this means that the
> > check is done based on the binding (battery.yaml) where the compatible
> > (simple-battery) is defined - not based on the properties which are present
> > in this file where the example resides, (and which references the
> > battery.yaml)?
> >
> > ...
> >
> > Oh... Now that I wrote it I feel like an idiot.
> >
> > This approach couldn't work for the validation, right? Let's assume I had a
> > VDR battery, and I added a static-battery -node for it. Running the
> > validation would pick the battery.yaml based on the compatible (just as it
> > does here), and be completely unaware of this vdr-battery.yaml. I have no
> > idea why I thought this would work. Probably because I only thought this
> > from the documentation POV.
> >
> > 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.
>
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.
Regards,
Andreas
next prev parent reply other threads:[~2025-11-14 17:43 UTC|newest]
Thread overview: 30+ 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 [this message]
2025-11-17 8:12 ` Matti Vaittinen
2025-11-17 15:23 ` Rob Herring
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-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=20251114184017.20d647da@kemnade.info \
--to=andreas@kemnade.info \
--cc=alexandre.belloni@bootlin.com \
--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=robh@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).