From: Rob Herring <robh@kernel.org>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Sebastian Reichel <sre@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Andreas Kemnade <andreas@kemnade.info>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-rtc@vger.kernel.org
Subject: Re: [PATCH v2 03/15] dt-bindings: power: supply: BD72720 managed battery
Date: Mon, 27 Oct 2025 16:08:16 -0500 [thread overview]
Message-ID: <20251027210816.GB1565353-robh@kernel.org> (raw)
In-Reply-To: <e8d0273bcf0ac67382e17c40be87d345e28ac06c.1761564043.git.mazziesaccount@gmail.com>
On Mon, Oct 27, 2025 at 01:45:23PM +0200, Matti Vaittinen wrote:
> 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>
> ---
> Revision history:
> 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.
>
> 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?).
> ---
> .../power/supply/rohm,vdr-battery.yaml | 80 +++++++++++++++++++
> 1 file changed, 80 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/power/supply/rohm,vdr-battery.yaml
>
> diff --git a/Documentation/devicetree/bindings/power/supply/rohm,vdr-battery.yaml b/Documentation/devicetree/bindings/power/supply/rohm,vdr-battery.yaml
> new file mode 100644
> index 000000000000..1ab3418d4338
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/rohm,vdr-battery.yaml
> @@ -0,0 +1,80 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/supply/rohm,vdr-battery.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Battery managed by the BD72720 PMIC
> +
> +maintainers:
> + - Matti Vaittinen <mazziesaccount@gmail.com>
> +
> +description:
> + A battery which has VDR parameters measuerd for ROHM chargers.
> +
> +allOf:
> + - $ref: battery.yaml#
> +
> +properties:
> + rohm,voltage-vdr-thresh-microvolt:
> + description: Threshold for starting the VDR correction
No constraints? Is 4000V okay?
> +
> + rohm,volt-drop-soc:
> + description: Table of capacity values matching the values in VDR tables.
> + The value should be given as tenths of a percentage.
We have a standard unit for this too. '-bp' or basis points (1/100 of
percent).
> + $ref: /schemas/types.yaml#/definitions/uint32-array
> +
> + rohm,volt-drop-temperatures-millicelsius:
> + description: An array containing the temperature in milli celsius, for each
> + of the VDR lookup table.
> +
> +patternProperties:
> + '^rohm,volt-drop-[0-9]-microvolt':
> + description: Table of the voltage drop rate (VDR) values. Each entry in the
> + table should match a capacity value in the rohm,volt-drop-soc table.
> + Furthermore, the values should be obtained for the temperature given in
> + rohm,volt-drop-temperatures-millicelsius table at index matching the
> + number in this table's name.
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + power {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + battery: battery {
> + compatible = "simple-battery";
> +
> + ocv-capacity-celsius = <25>;
> + ocv-capacity-table-0 = <4200000 100 4184314 100 4140723 95 4099487 90
> + 4060656 85 4024350 80 3991121 75 3954379 70 3913265 65 3877821 60
> + 3855577 55 3837466 50 3822194 45 3809012 40 3795984 35 3780647 30
> + 3760505 25 3741532 20 3718837 15 3696698 10 3690594 5 3581427 0>;
> +
> + rohm,volt-drop-soc = <1000 1000 950 900 850 800 750 700 650 600 550 500
> + 450 400 350 300 250 200 150 100 50 00 (-50)>;
> +
> + rohm,volt-drop-temperatures-millicelsius = <45000 25000 5000 0>;
> +
> + rohm,volt-drop-0-microvolt = <100 100 102 104 106 109 114 124
> + 117 107 107 109 112 116 117 108 109 109 108 109 122 126 130>;
> +
> + rohm,volt-drop-1-microvolt = <100 100 102 105 98 100 105 102
> + 101 99 98 100 103 105 109 117 111 109 110 114 128 141 154>;
> +
> + rohm,volt-drop-2-microvolt = <100 100 98 107 112 114 118 118 112
> + 108 108 110 111 113 117 123 131 144 157 181 220 283 399>;
> +
> + rohm,volt-drop-3-temp-microvolt = <86 86 105 109 114 110 115 115
> + 110 108 110 112 114 118 124 134 136 160 177 201 241 322 403>;
> +
> + rohm,voltage-vdr-thresh-microvolt = <4150000>;
> +
> + charge-full-design-microamp-hours = <1799000>;
> + voltage-max-design-microvolt = <4200000>;
> + voltage-min-design-microvolt = <3500000>;
> + degrade-cycle-microamp-hours = <131>;
> + };
> + };
> --
> 2.51.0
>
next prev parent reply other threads:[~2025-10-27 21:08 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 11:44 [PATCH v2 00/15] Support ROHM BD72720 PMIC Matti Vaittinen
2025-10-27 11:44 ` [PATCH v2 01/15] dt-bindings: regulator: ROHM BD72720 Matti Vaittinen
2025-10-27 21:03 ` Rob Herring
2025-10-27 11:45 ` [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit Matti Vaittinen
2025-10-29 6:03 ` Krzysztof Kozlowski
2025-10-29 6:17 ` Krzysztof Kozlowski
2025-10-29 6:24 ` Matti Vaittinen
2025-10-29 6:22 ` Matti Vaittinen
2025-10-29 6:32 ` Matti Vaittinen
2025-10-29 13:26 ` Linus Walleij
2025-10-29 13:33 ` Krzysztof Kozlowski
2025-10-27 11:45 ` [PATCH v2 03/15] dt-bindings: power: supply: BD72720 managed battery Matti Vaittinen
2025-10-27 21:08 ` Rob Herring [this message]
2025-10-27 22:34 ` Linus Walleij
2025-10-27 11:45 ` [PATCH v2 04/15] dt-bindings: mfd: ROHM BD72720 Matti Vaittinen
2025-10-27 21:13 ` Rob Herring
2025-10-29 12:22 ` Matti Vaittinen
2025-10-27 21:20 ` Andreas Kemnade
2025-10-29 12:23 ` Matti Vaittinen
2025-10-27 22:42 ` Linus Walleij
2025-10-29 12:30 ` Matti Vaittinen
2025-10-29 13:08 ` Linus Walleij
2025-10-27 11:46 ` [PATCH v2 05/15] dt-bindings: leds: bd72720: Add BD72720 Matti Vaittinen
2025-10-28 8:25 ` Krzysztof Kozlowski
2025-10-27 11:46 ` [PATCH v2 06/15] mfd: rohm-bd71828: Use regmap_reg_range() Matti Vaittinen
2025-10-27 11:46 ` [PATCH v2 08/15] regulator: bd71828: rename IC specific entities Matti Vaittinen
2025-10-27 12:14 ` Mark Brown
2025-10-27 11:47 ` [PATCH v2 09/15] regulator: bd71828: Support ROHM BD72720 Matti Vaittinen
2025-10-27 12:15 ` Mark Brown
2025-10-27 11:47 ` [PATCH v2 10/15] gpio: Support ROHM BD72720 gpios Matti Vaittinen
2025-10-27 11:47 ` [PATCH v2 11/15] clk: clk-bd718x7: Support BD72720 clk gate Matti Vaittinen
2025-10-27 11:47 ` [PATCH v2 12/15] rtc: bd70528: Support BD72720 rtc Matti Vaittinen
2025-10-27 12:38 ` Alexandre Belloni
2025-10-27 13:02 ` Matti Vaittinen
2025-10-27 11:48 ` [PATCH v2 13/15] power: supply: bd71828: Support wider register addresses Matti Vaittinen
2025-10-27 11:48 ` [PATCH v2 14/15] power: supply: bd71828-power: Support ROHM BD72720 Matti Vaittinen
2025-10-27 11:48 ` [PATCH v2 15/15] MAINTAINERS: Add ROHM BD72720 PMIC Matti Vaittinen
2025-10-28 6:06 ` [PATCH v2 07/15] mfd: bd71828: Support ROHM BD72720 Matti Vaittinen
2025-10-28 6:39 ` [PATCH v2 00/15] Support 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=20251027210816.GB1565353-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=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
all inboxes | Powered by JetHome®