diff mbox

[v3,01/18] dt-bindings: power: battery: add constant-charge-current property

Message ID 20170214094112.27426-2-quentin.schulz@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Quentin Schulz Feb. 14, 2017, 9:40 a.m. UTC
This adds the constant-charge-current property to the list of optional
properties of the battery.

The constant charge current is critical for batteries as they can't
handle all charge currents.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
---

added in v3

 Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++
 1 file changed, 2 insertions(+)

Comments

Liam Breck Feb. 15, 2017, 12:46 a.m. UTC | #1
On Tue, 14 Feb 2017 10:40:55 +0100 Quentin Schulz wrote:
> This adds the constant-charge-current property to the list of optional
> properties of the battery.
>
> The constant charge current is critical for batteries as they can't
> handle all charge currents.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> ---
>
> added in v3
>
>  Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++

Is constant-charge-current dependent on the battery (e.g. capacity, nominal voltage, etc) or the 
system (charger chip, input current/voltage, etc)?

It belongs in Doc.../power/supply/battery.txt if it's a characteristic of the battery.

Note, this page asserts that constant-current charging applies to NiMH batteries:
http://power-topics.blogspot.com/2016/05/constant-voltage-constant-current.html

Related properties to be added to battery.txt near-future in a patchset for the BQ24190 
charger are as follows. These are not currently in enum power_supply_property, so the actual names 
are still to be decided.

precharge-current-microamp:
   maximum charge current during precharge phase (typically 20% of battery capacity)

termination-current-microamp (or endcharge-current):
   a charge cycle terminates when the battery voltage is above recharge threshold,
   and the current is below this setting (typically 10% of battery capacity)


~.~
Quentin Schulz Feb. 15, 2017, 8:53 a.m. UTC | #2
Hi,

On 15/02/2017 01:46, Liam Breck wrote:
> 
> On Tue, 14 Feb 2017 10:40:55 +0100 Quentin Schulz wrote:
>> This adds the constant-charge-current property to the list of optional
>> properties of the battery.
>>
>> The constant charge current is critical for batteries as they can't
>> handle all charge currents.
>>
>> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
>> ---
>>
>> added in v3
>>
>>  Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++
> 
> Is constant-charge-current dependent on the battery (e.g. capacity, nominal voltage, etc) or the 
> system (charger chip, input current/voltage, etc)?
> 
> It belongs in Doc.../power/supply/battery.txt if it's a characteristic of the battery.
> 
> Note, this page asserts that constant-current charging applies to NiMH batteries:
> http://power-topics.blogspot.com/2016/05/constant-voltage-constant-current.html
> 
> Related properties to be added to battery.txt near-future in a patchset for the BQ24190 
> charger are as follows. These are not currently in enum power_supply_property, so the actual names 
> are still to be decided.
> 
> precharge-current-microamp:
>    maximum charge current during precharge phase (typically 20% of battery capacity)
> 
> termination-current-microamp (or endcharge-current):
>    a charge cycle terminates when the battery voltage is above recharge threshold,
>    and the current is below this setting (typically 10% of battery capacity)
> 

We have a client with a board whose battery accepts a maximum of 300mA
for charging. So depending on the battery, we cannot have any charging
current we want. The AXP PmMICs set constant charge current in a range
of 300mA-1800mA, so it is enforced by the charger but needs to be
adapted depending on the battery present in the system.

The AXP PMICs charge battery with constant current (Ichrg) between the
trickle voltage (Vtrkl which is ~3.0V) and the targeted voltage (Vtrgt;
which seems to be the voltage telling the battery is fully charged).

So if I understand correctly, "my" constant-charge-current would be
located in the charging cycle between your precharge-current-microamp
and the termination-current-microamp as it is the current for the
charging process as a whole.

See here[1] for the explanation in the datasheet (page 20).

That would definitely match what is explained in your link for constant
current.

[1] http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf

Let me know if something seems odd,
Thanks,
Quentin
Liam Breck Feb. 15, 2017, 8:18 p.m. UTC | #3
On Wed, Feb 15, 2017 at 12:53 AM, Quentin Schulz
<quentin.schulz@free-electrons.com> wrote:
> Hi,
>
> On 15/02/2017 01:46, Liam Breck wrote:
>>
>> On Tue, 14 Feb 2017 10:40:55 +0100 Quentin Schulz wrote:
>>> This adds the constant-charge-current property to the list of optional
>>> properties of the battery.
>>>
>>> The constant charge current is critical for batteries as they can't
>>> handle all charge currents.
>>>
>>> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
>>> ---
>>>
>>> added in v3
>>>
>>>  Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++
>>
>> Is constant-charge-current dependent on the battery (e.g. capacity, nominal voltage, etc) or the
>> system (charger chip, input current/voltage, etc)?
>>
>> It belongs in Doc.../power/supply/battery.txt if it's a characteristic of the battery.
>>
>> Note, this page asserts that constant-current charging applies to NiMH batteries:
>> http://power-topics.blogspot.com/2016/05/constant-voltage-constant-current.html
>>
>> Related properties to be added to battery.txt near-future in a patchset for the BQ24190
>> charger are as follows. These are not currently in enum power_supply_property, so the actual names
>> are still to be decided.
>>
>> precharge-current-microamp:
>>    maximum charge current during precharge phase (typically 20% of battery capacity)
>>
>> termination-current-microamp (or endcharge-current):
>>    a charge cycle terminates when the battery voltage is above recharge threshold,
>>    and the current is below this setting (typically 10% of battery capacity)
>>
>
> We have a client with a board whose battery accepts a maximum of 300mA
> for charging. So depending on the battery, we cannot have any charging
> current we want. The AXP PmMICs set constant charge current in a range
> of 300mA-1800mA, so it is enforced by the charger but needs to be
> adapted depending on the battery present in the system.
>
> The AXP PMICs charge battery with constant current (Ichrg) between the
> trickle voltage (Vtrkl which is ~3.0V) and the targeted voltage (Vtrgt;
> which seems to be the voltage telling the battery is fully charged).
>
> So if I understand correctly, "my" constant-charge-current would be
> located in the charging cycle between your precharge-current-microamp
> and the termination-current-microamp as it is the current for the
> charging process as a whole.
>
> See here[1] for the explanation in the datasheet (page 20).
>
> That would definitely match what is explained in your link for constant
> current.
>
> [1] http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf
>
> Let me know if something seems odd,

Sounds OK to me. I'm happy to ack this, after my patchset goes in.
I'll be posting v7 this weekend, with a minor addition to battery.txt.

BTW there's rather a lot of ppl and lists CC'd on this, none of which
are listed in the patch comment...

> Thanks,
> Quentin
>
> --
> Quentin Schulz, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
Chen-Yu Tsai Feb. 21, 2017, 4:55 a.m. UTC | #4
On Wed, Feb 15, 2017 at 4:53 PM, Quentin Schulz
<quentin.schulz@free-electrons.com> wrote:
> Hi,
>
> On 15/02/2017 01:46, Liam Breck wrote:
>>
>> On Tue, 14 Feb 2017 10:40:55 +0100 Quentin Schulz wrote:
>>> This adds the constant-charge-current property to the list of optional
>>> properties of the battery.
>>>
>>> The constant charge current is critical for batteries as they can't
>>> handle all charge currents.
>>>
>>> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
>>> ---
>>>
>>> added in v3
>>>
>>>  Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++
>>
>> Is constant-charge-current dependent on the battery (e.g. capacity, nominal voltage, etc) or the
>> system (charger chip, input current/voltage, etc)?
>>
>> It belongs in Doc.../power/supply/battery.txt if it's a characteristic of the battery.
>>
>> Note, this page asserts that constant-current charging applies to NiMH batteries:
>> http://power-topics.blogspot.com/2016/05/constant-voltage-constant-current.html
>>
>> Related properties to be added to battery.txt near-future in a patchset for the BQ24190
>> charger are as follows. These are not currently in enum power_supply_property, so the actual names
>> are still to be decided.
>>
>> precharge-current-microamp:
>>    maximum charge current during precharge phase (typically 20% of battery capacity)
>>
>> termination-current-microamp (or endcharge-current):
>>    a charge cycle terminates when the battery voltage is above recharge threshold,
>>    and the current is below this setting (typically 10% of battery capacity)
>>
>
> We have a client with a board whose battery accepts a maximum of 300mA
> for charging. So depending on the battery, we cannot have any charging
> current we want. The AXP PmMICs set constant charge current in a range
> of 300mA-1800mA, so it is enforced by the charger but needs to be
> adapted depending on the battery present in the system.

May I ask the capacity of the battery in question?

Typically one charges LiPo batteries at no more than 1C. So if it's
a 1800 mAh battery, the charge current should be no more than 1800 mA.

ChenYu

> The AXP PMICs charge battery with constant current (Ichrg) between the
> trickle voltage (Vtrkl which is ~3.0V) and the targeted voltage (Vtrgt;
> which seems to be the voltage telling the battery is fully charged).
>
> So if I understand correctly, "my" constant-charge-current would be
> located in the charging cycle between your precharge-current-microamp
> and the termination-current-microamp as it is the current for the
> charging process as a whole.
>
> See here[1] for the explanation in the datasheet (page 20).
>
> That would definitely match what is explained in your link for constant
> current.
>
> [1] http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf
>
> Let me know if something seems odd,
> Thanks,
> Quentin
>
> --
> Quentin Schulz, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
Rob Herring (Arm) Feb. 22, 2017, 9:25 p.m. UTC | #5
On Tue, Feb 14, 2017 at 10:40:55AM +0100, Quentin Schulz wrote:
> This adds the constant-charge-current property to the list of optional
> properties of the battery.
> 
> The constant charge current is critical for batteries as they can't
> handle all charge currents.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> ---
> 
> added in v3
> 
>  Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt
> index d78a4aa..3e830fe 100644
> --- a/Documentation/devicetree/bindings/power/supply/battery.txt
> +++ b/Documentation/devicetree/bindings/power/supply/battery.txt
> @@ -7,6 +7,7 @@ Optional Properties:
>   - voltage-min-design-microvolt: drained battery voltage
>   - energy-full-design-microwatt-hours: battery design energy
>   - charge-full-design-microamp-hours: battery design capacity
> + - constant-charge-current-microamp: battery constant charge current

Kind of long, though so are the others. Maybe just 
"constant-charge-microamp" as uA implies current.

Otherwise,

Acked-by: Rob Herring <robh@kernel.org>
Quentin Schulz March 14, 2017, 1:44 p.m. UTC | #6
Hi Chen-Yu,

Sorry for the late reply.

On 21/02/2017 05:55, Chen-Yu Tsai wrote:
> On Wed, Feb 15, 2017 at 4:53 PM, Quentin Schulz
> <quentin.schulz@free-electrons.com> wrote:
>> Hi,
>>
>> On 15/02/2017 01:46, Liam Breck wrote:
>>>
>>> On Tue, 14 Feb 2017 10:40:55 +0100 Quentin Schulz wrote:
>>>> This adds the constant-charge-current property to the list of optional
>>>> properties of the battery.
>>>>
>>>> The constant charge current is critical for batteries as they can't
>>>> handle all charge currents.
>>>>
>>>> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
>>>> ---
>>>>
>>>> added in v3
>>>>
>>>>  Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++
>>>
>>> Is constant-charge-current dependent on the battery (e.g. capacity, nominal voltage, etc) or the
>>> system (charger chip, input current/voltage, etc)?
>>>
>>> It belongs in Doc.../power/supply/battery.txt if it's a characteristic of the battery.
>>>
>>> Note, this page asserts that constant-current charging applies to NiMH batteries:
>>> http://power-topics.blogspot.com/2016/05/constant-voltage-constant-current.html
>>>
>>> Related properties to be added to battery.txt near-future in a patchset for the BQ24190
>>> charger are as follows. These are not currently in enum power_supply_property, so the actual names
>>> are still to be decided.
>>>
>>> precharge-current-microamp:
>>>    maximum charge current during precharge phase (typically 20% of battery capacity)
>>>
>>> termination-current-microamp (or endcharge-current):
>>>    a charge cycle terminates when the battery voltage is above recharge threshold,
>>>    and the current is below this setting (typically 10% of battery capacity)
>>>
>>
>> We have a client with a board whose battery accepts a maximum of 300mA
>> for charging. So depending on the battery, we cannot have any charging
>> current we want. The AXP PmMICs set constant charge current in a range
>> of 300mA-1800mA, so it is enforced by the charger but needs to be
>> adapted depending on the battery present in the system.
> 
> May I ask the capacity of the battery in question?
> 

It is a 400mAh battery.

Quentin

> Typically one charges LiPo batteries at no more than 1C. So if it's
> a 1800 mAh battery, the charge current should be no more than 1800 mA.
> 
> ChenYu
> 
>> The AXP PMICs charge battery with constant current (Ichrg) between the
>> trickle voltage (Vtrkl which is ~3.0V) and the targeted voltage (Vtrgt;
>> which seems to be the voltage telling the battery is fully charged).
>>
>> So if I understand correctly, "my" constant-charge-current would be
>> located in the charging cycle between your precharge-current-microamp
>> and the termination-current-microamp as it is the current for the
>> charging process as a whole.
>>
>> See here[1] for the explanation in the datasheet (page 20).
>>
>> That would definitely match what is explained in your link for constant
>> current.
>>
>> [1] http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf
>>
>> Let me know if something seems odd,
>> Thanks,
>> Quentin
>>
>> --
>> Quentin Schulz, Free Electrons
>> Embedded Linux and Kernel engineering
>> http://free-electrons.com
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt
index d78a4aa..3e830fe 100644
--- a/Documentation/devicetree/bindings/power/supply/battery.txt
+++ b/Documentation/devicetree/bindings/power/supply/battery.txt
@@ -7,6 +7,7 @@  Optional Properties:
  - voltage-min-design-microvolt: drained battery voltage
  - energy-full-design-microwatt-hours: battery design energy
  - charge-full-design-microamp-hours: battery design capacity
+ - constant-charge-current-microamp: battery constant charge current
 
 Future Properties must be named for the corresponding elements in
 enum power_supply_property, defined in include/linux/power_supply.h.
@@ -22,6 +23,7 @@  Example:
 		voltage-min-design-microvolt = <3200000>;
 		energy-full-design-microwatt-hours = <5290000>;
 		charge-full-design-microamp-hours = <1430000>;
+		constant-charge-current-microamp = <300000>;
 	};
 
 	charger: charger@11 {