[PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit

Matti Vaittinen posted 15 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Matti Vaittinen 3 months, 2 weeks ago
Some of the chargers for lithium-ion batteries use a trickle-charging as
a first charging phase for very empty batteries, to "wake-up" the battery.
Trickle-charging is a low current, constant current phase. After the
voltage of the very empty battery has reached an upper limit for
trickle charging, the pre-charge phase is started with a higher current.

Allow defining the upper limit for trickle charging voltage, after which
the charging should be changed to the pre-charging.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

---
Revision history:
 RFCv1 =>:
 - No changes
---
 Documentation/devicetree/bindings/power/supply/battery.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/supply/battery.yaml b/Documentation/devicetree/bindings/power/supply/battery.yaml
index 491488e7b970..66bed24b3dee 100644
--- a/Documentation/devicetree/bindings/power/supply/battery.yaml
+++ b/Documentation/devicetree/bindings/power/supply/battery.yaml
@@ -66,6 +66,9 @@ properties:
   trickle-charge-current-microamp:
     description: current for trickle-charge phase
 
+  tricklecharge-upper-limit-microvolt:
+    description: limit when to change to precharge from trickle charge
+
   precharge-current-microamp:
     description: current for pre-charge phase
 
-- 
2.51.0

Re: [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Krzysztof Kozlowski 3 months, 1 week ago
On Mon, Oct 27, 2025 at 01:45:05PM +0200, Matti Vaittinen wrote:
> Some of the chargers for lithium-ion batteries use a trickle-charging as
> a first charging phase for very empty batteries, to "wake-up" the battery.

In the few cases I was dealing with charging circuits, trickle charging
was used in context of top-off charging, so when battery is 100%. It's
also documented at Wiki like that:
https://en.wikipedia.org/wiki/Trickle_charging

> Trickle-charging is a low current, constant current phase. After the
> voltage of the very empty battery has reached an upper limit for
> trickle charging, the pre-charge phase is started with a higher current.
> 
> Allow defining the upper limit for trickle charging voltage, after which
> the charging should be changed to the pre-charging.

pre-charging is the trickle charging, no? Or you want to say that
trickle-charging is pre-pre-charging? But then what is pre-charging in
this binding?

> 
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 
> ---
> Revision history:
>  RFCv1 =>:
>  - No changes
> ---
>  Documentation/devicetree/bindings/power/supply/battery.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/battery.yaml b/Documentation/devicetree/bindings/power/supply/battery.yaml
> index 491488e7b970..66bed24b3dee 100644
> --- a/Documentation/devicetree/bindings/power/supply/battery.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/battery.yaml
> @@ -66,6 +66,9 @@ properties:
>    trickle-charge-current-microamp:
>      description: current for trickle-charge phase
>  
> +  tricklecharge-upper-limit-microvolt:

Please keep existing format, look three lines above. trickle-charge-....

But I believe this is wrong. Trickle charging does not switch to
anything more, there is no fast charging after trickle. You have some
sort of pre-pre-charging, which is just pre-charging.

Best regards,
Krzysztof
Re: [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Matti Vaittinen 3 months, 1 week ago
On 29/10/2025 08:03, Krzysztof Kozlowski wrote:
> On Mon, Oct 27, 2025 at 01:45:05PM +0200, Matti Vaittinen wrote:
>> Some of the chargers for lithium-ion batteries use a trickle-charging as
>> a first charging phase for very empty batteries, to "wake-up" the battery.
> 
> In the few cases I was dealing with charging circuits, trickle charging
> was used in context of top-off charging, so when battery is 100%. It's
> also documented at Wiki like that:
> https://en.wikipedia.org/wiki/Trickle_charging
> 
>> Trickle-charging is a low current, constant current phase. After the
>> voltage of the very empty battery has reached an upper limit for
>> trickle charging, the pre-charge phase is started with a higher current.
>>
>> Allow defining the upper limit for trickle charging voltage, after which
>> the charging should be changed to the pre-charging.


> pre-charging is the trickle charging, no? Or you want to say that
> trickle-charging is pre-pre-charging? But then what is pre-charging in
> this binding?

There are the (usual?) pre-charging and fast-charging phases in the Rohm 
devices. Furthermore, the fast-charging is divided to constant current 
and constant voltage phases.

In addition to this, there is a 'trickle-charging' -phase for a very 
empty battery. This is already reflected by existing bindings:
trickle-charge-current-microamp, Please, see:
bbcecd1b9335 ("dt-bindings: Add trickle-charge upper limit")

I also did do some ASCII art for my very first charger driver binding:
https://elixir.bootlin.com/linux/v6.18-rc1/source/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml

Do you think a comment linking to this drawing would help?

> 
>>
>> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> ---
>> Revision history:
>>   RFCv1 =>:
>>   - No changes
>> ---
>>   Documentation/devicetree/bindings/power/supply/battery.yaml | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/power/supply/battery.yaml b/Documentation/devicetree/bindings/power/supply/battery.yaml
>> index 491488e7b970..66bed24b3dee 100644
>> --- a/Documentation/devicetree/bindings/power/supply/battery.yaml
>> +++ b/Documentation/devicetree/bindings/power/supply/battery.yaml
>> @@ -66,6 +66,9 @@ properties:
>>     trickle-charge-current-microamp:
>>       description: current for trickle-charge phase
>>   
>> +  tricklecharge-upper-limit-microvolt:
> 
> Please keep existing format, look three lines above. trickle-charge-....
> 
> But I believe this is wrong. Trickle charging does not switch to
> anything more, there is no fast charging after trickle. You have some
> sort of pre-pre-charging, which is just pre-charging.

There is trickle, pre and fast-charge phases. Furthermore, the 
fast-charge is further divided to CC and CV. Finally, if my memory 
serves me well, Linus W did explain me that some chargers use 
'trickle-charging' as a _last_ charging phase for a full battery. Thus 
the term 'trickle-charging' is slightly confusing - but it is already 
used by the existing bindings...

https://lore.kernel.org/all/20211116001755.2132036-1-linus.walleij@linaro.org/


Yours,
	-- Matti
Re: [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Linus Walleij 3 months, 1 week ago
On Wed, Oct 29, 2025 at 7:22 AM Matti Vaittinen
<mazziesaccount@gmail.com> wrote:

> > But I believe this is wrong. Trickle charging does not switch to
> > anything more, there is no fast charging after trickle. You have some
> > sort of pre-pre-charging, which is just pre-charging.
>
> There is trickle, pre and fast-charge phases. Furthermore, the
> fast-charge is further divided to CC and CV. Finally, if my memory
> serves me well, Linus W did explain me that some chargers use
> 'trickle-charging' as a _last_ charging phase for a full battery. Thus
> the term 'trickle-charging' is slightly confusing - but it is already
> used by the existing bindings...
>
> https://lore.kernel.org/all/20211116001755.2132036-1-linus.walleij@linaro.org/

I think we need to refer to a textbook or IEEE articles to get this
terminology right.

As you say it appears "trickle-charging" is ambiguous.

Maybe what Krzysztof suggest to use: "pre-pre-charging" or
"empty-battery-charging" or something like this is needed.

But we really need a trustworthy academic source here.

Yours,
Linus Walleij
Re: [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Krzysztof Kozlowski 3 months, 1 week ago
On 29/10/2025 14:26, Linus Walleij wrote:
> On Wed, Oct 29, 2025 at 7:22 AM Matti Vaittinen
> <mazziesaccount@gmail.com> wrote:
> 
>>> But I believe this is wrong. Trickle charging does not switch to
>>> anything more, there is no fast charging after trickle. You have some
>>> sort of pre-pre-charging, which is just pre-charging.
>>
>> There is trickle, pre and fast-charge phases. Furthermore, the
>> fast-charge is further divided to CC and CV. Finally, if my memory
>> serves me well, Linus W did explain me that some chargers use
>> 'trickle-charging' as a _last_ charging phase for a full battery. Thus
>> the term 'trickle-charging' is slightly confusing - but it is already
>> used by the existing bindings...
>>
>> https://lore.kernel.org/all/20211116001755.2132036-1-linus.walleij@linaro.org/
> 
> I think we need to refer to a textbook or IEEE articles to get this
> terminology right.
> 
> As you say it appears "trickle-charging" is ambiguous.
> 
> Maybe what Krzysztof suggest to use: "pre-pre-charging" or
> "empty-battery-charging" or something like this is needed.
> 
> But we really need a trustworthy academic source here.

Trickle charging is accurate for both cases - pre-pre and top-off -
because it just describes very small current. That's why I found it in
many TI datasheets - mostly for Li-Ion batteries describing Matti's
case, but also in at least one case for Ni-Mh describing top-off (or
maintenance).

I am fine with the naming, but I want to be clear that this property
will describe trickle only in case of pre-pre charging. Termination
voltage simply does not fit the top-off/maintenance mode.

Best regards,
Krzysztof
Re: [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Matti Vaittinen 3 months, 1 week ago
ke 29.10.2025 klo 8.22 Matti Vaittinen (mazziesaccount@gmail.com) kirjoitti:
>
> On 29/10/2025 08:03, Krzysztof Kozlowski wrote:
> > On Mon, Oct 27, 2025 at 01:45:05PM +0200, Matti Vaittinen wrote:
> >> Some of the chargers for lithium-ion batteries use a trickle-charging as
> >> a first charging phase for very empty batteries, to "wake-up" the battery.
> >
>This is already reflected by existing bindings:
> trickle-charge-current-microamp, Please, see:
> bbcecd1b9335 ("dt-bindings: Add trickle-charge upper limit")
>
Sorry, wrong commit! It should have been the
e3420b49949c ("dt-bindings: battery: add new battery parameters")
as you found out.

(Just a clarification for anyone reading this thread)
Re: [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Krzysztof Kozlowski 3 months, 1 week ago
On 29/10/2025 07:03, Krzysztof Kozlowski wrote:
> On Mon, Oct 27, 2025 at 01:45:05PM +0200, Matti Vaittinen wrote:
>> Some of the chargers for lithium-ion batteries use a trickle-charging as
>> a first charging phase for very empty batteries, to "wake-up" the battery.
> 
> In the few cases I was dealing with charging circuits, trickle charging
> was used in context of top-off charging, so when battery is 100%. It's
> also documented at Wiki like that:
> https://en.wikipedia.org/wiki/Trickle_charging
> 
>> Trickle-charging is a low current, constant current phase. After the
>> voltage of the very empty battery has reached an upper limit for
>> trickle charging, the pre-charge phase is started with a higher current.
>>
>> Allow defining the upper limit for trickle charging voltage, after which
>> the charging should be changed to the pre-charging.
> 
> pre-charging is the trickle charging, no? Or you want to say that
> trickle-charging is pre-pre-charging? But then what is pre-charging in
> this binding?


Now I see that you added initial trickle-charging in commit
e3420b49949c79d6182dd8128fa7a3958da01b07. I looked at TI chargers for
LiIon/LiPo batteries and few popular models use the same meaning/cycles
as you here. Probably in LiIon/LiPo you cannot or should not use trickle
for top-off charging (CV phase).

For NiMh these TI chargers use term "Trickle Maintenance Charge" (e.g.
bq24400), so in separate or this patch please also clarify the
description of properties that this is trickle-charging for LiIon/LiPo
batteries, so the pre-pre charging.

Best regards,
Krzysztof
Re: [PATCH v2 02/15] dt-bindings: Add trickle-charge upper limit
Posted by Matti Vaittinen 3 months, 1 week ago
On 29/10/2025 08:17, Krzysztof Kozlowski wrote:
> On 29/10/2025 07:03, Krzysztof Kozlowski wrote:
>> On Mon, Oct 27, 2025 at 01:45:05PM +0200, Matti Vaittinen wrote:
>>> Some of the chargers for lithium-ion batteries use a trickle-charging as
>>> a first charging phase for very empty batteries, to "wake-up" the battery.
>>
>> In the few cases I was dealing with charging circuits, trickle charging
>> was used in context of top-off charging, so when battery is 100%. It's
>> also documented at Wiki like that:
>> https://en.wikipedia.org/wiki/Trickle_charging
>>
>>> Trickle-charging is a low current, constant current phase. After the
>>> voltage of the very empty battery has reached an upper limit for
>>> trickle charging, the pre-charge phase is started with a higher current.
>>>
>>> Allow defining the upper limit for trickle charging voltage, after which
>>> the charging should be changed to the pre-charging.
>>
>> pre-charging is the trickle charging, no? Or you want to say that
>> trickle-charging is pre-pre-charging? But then what is pre-charging in
>> this binding?
> 
> 
> Now I see that you added initial trickle-charging in commit
> e3420b49949c79d6182dd8128fa7a3958da01b07. I looked at TI chargers for
> LiIon/LiPo batteries and few popular models use the same meaning/cycles
> as you here. Probably in LiIon/LiPo you cannot or should not use trickle
> for top-off charging (CV phase).
> 
> For NiMh these TI chargers use term "Trickle Maintenance Charge" (e.g.
> bq24400), so in separate or this patch please also clarify the
> description of properties that this is trickle-charging for LiIon/LiPo
> batteries, so the pre-pre charging.

Right. I'll try improving the description. Thanks!

> 
> Best regards,
> Krzysztof