mbox series

[V5,0/2] power: bq27xxx: add bq78z100

Message ID 20210305064949.2680-1-Qing-wu.Li@leica-geosystems.com.cn
Headers show
Series power: bq27xxx: add bq78z100 | expand

Message

LI Qingwu March 5, 2021, 6:49 a.m. UTC
Changes in V5:

1. Change [BQ27XXX_REG_TTES] from INVALID_REG_ADDR to 0x1c,
the StandbyTimeToEmpty command of bq78z100.
2. Add [BQ27XXX_REG_RC] = 0x10. the RemainingCapacity command of
bq78z100.
3. Set [BQ27XXX_REG_AE] to INVALID_REG_ADDR, support by bq78z100.
4. Delete property POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, not support
by bq78z100

LI Qingwu (2):
  dt-bindings: power: bq27xxx: add bq78z100
  power: supply: bq27xxx: Add support for BQ78Z100

 .../bindings/power/supply/bq27xxx.yaml        |  1 +
 drivers/power/supply/bq27xxx_battery.c        | 44 +++++++++++++++++++
 drivers/power/supply/bq27xxx_battery_i2c.c    |  2 +
 include/linux/power/bq27xxx_battery.h         |  1 +
 4 files changed, 48 insertions(+)

Comments

Sebastian Reichel March 14, 2021, 11:42 p.m. UTC | #1
Hi,

On Fri, Mar 05, 2021 at 06:49:47AM +0000, LI Qingwu wrote:
> Changes in V5:

> 

> 1. Change [BQ27XXX_REG_TTES] from INVALID_REG_ADDR to 0x1c,

> the StandbyTimeToEmpty command of bq78z100.

> 2. Add [BQ27XXX_REG_RC] = 0x10. the RemainingCapacity command of

> bq78z100.

> 3. Set [BQ27XXX_REG_AE] to INVALID_REG_ADDR, support by bq78z100.

> 4. Delete property POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, not support

> by bq78z100


I also asked to check other exposed properties and to provide
a dump of the power-supply uevent in commit message or cover
letter to verify chip works as expected. I cannot see the dump
and you are exposing at least one property that always reports
-ENODATA. I intentionally will not point out the exact property,
so that you have to properly test your patch before submitting.

Thanks,

-- Sebastian

> LI Qingwu (2):

>   dt-bindings: power: bq27xxx: add bq78z100

>   power: supply: bq27xxx: Add support for BQ78Z100

> 

>  .../bindings/power/supply/bq27xxx.yaml        |  1 +

>  drivers/power/supply/bq27xxx_battery.c        | 44 +++++++++++++++++++

>  drivers/power/supply/bq27xxx_battery_i2c.c    |  2 +

>  include/linux/power/bq27xxx_battery.h         |  1 +

>  4 files changed, 48 insertions(+)

> 

> -- 

> 2.17.1

>
LI Qingwu March 15, 2021, 7:52 a.m. UTC | #2
Hi Sebastian,

Thanks for your input, I will and dump message into next version patch.



Best Regards

**********************************************
Li Qingwu (Terry)
Senior Embedded Software Engineer 
Leica Geosystems(Shanghai)Co.,Limited
(Tel): +86 21 61061036
(FAX): +86 21 61061008
(Mobile): +86 187 0185 9600
E-mail: Qing-wu.Li@leica-geosystems.com.cn
Http: www.leica-geosystems.com.cn
**********************************************

-----Original Message-----
From: Sebastian Reichel <sre@kernel.org> 

Sent: Monday, March 15, 2021 7:42 AM
To: LI Qingwu <qing-wu.li@leica-geosystems.com.cn>
Cc: robh+dt@kernel.org; pali@kernel.org; krzk@kernel.org; afd@ti.com; linux-pm@vger.kernel.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; TERTYCHNYI Grygorii <grygorii.tertychnyi@leica-geosystems.com>; ZHIZHIKIN Andrey <andrey.zhizhikin@leica-geosystems.com>
Subject: Re: [PATCH V5 0/2] power: bq27xxx: add bq78z100

Hi,

On Fri, Mar 05, 2021 at 06:49:47AM +0000, LI Qingwu wrote:
> Changes in V5:

> 

> 1. Change [BQ27XXX_REG_TTES] from INVALID_REG_ADDR to 0x1c, the 

> StandbyTimeToEmpty command of bq78z100.

> 2. Add [BQ27XXX_REG_RC] = 0x10. the RemainingCapacity command of 

> bq78z100.

> 3. Set [BQ27XXX_REG_AE] to INVALID_REG_ADDR, support by bq78z100.

> 4. Delete property POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, not support by 

> bq78z100


I also asked to check other exposed properties and to provide a dump of the power-supply uevent in commit message or cover letter to verify chip works as expected. I cannot see the dump and you are exposing at least one property that always reports -ENODATA. I intentionally will not point out the exact property, so that you have to properly test your patch before submitting.

Thanks,

-- Sebastian

> LI Qingwu (2):

>   dt-bindings: power: bq27xxx: add bq78z100

>   power: supply: bq27xxx: Add support for BQ78Z100

> 

>  .../bindings/power/supply/bq27xxx.yaml        |  1 +

>  drivers/power/supply/bq27xxx_battery.c        | 44 +++++++++++++++++++

>  drivers/power/supply/bq27xxx_battery_i2c.c    |  2 +

>  include/linux/power/bq27xxx_battery.h         |  1 +

>  4 files changed, 48 insertions(+)

> 

> --

> 2.17.1

>
LI Qingwu March 17, 2021, 9:47 a.m. UTC | #3
Hi Sebastian,

Here is the dump of the "uevent", I tested two cases, discharging current >0 and discharging current =0.
If discharging current=0:
    POWER_SUPPLY_TIME_TO_EMPTY_NOW and POWER_SUPPLY_TIME_TO_FULL_NOW are disappear, 
    the value is "-ENODATA"
If discharging current>0:
    POWER_SUPPLY_TIME_TO_FULL_NOW is disappear, 
    the value is "-ENODATA"
Since I can't test charging on our hardware, I think "POWER_SUPPLY_TIME_TO_FULL_NOW" will show up during charging, since the value is given by register 0x18 with index "BQ27XXX_REG_TTF".

TEST CASE I:  discharging current >0:
    POWER_SUPPLY_NAME=bq78z100-0
    POWER_SUPPLY_STATUS=Discharging
    POWER_SUPPLY_PRESENT=1
    POWER_SUPPLY_VOLTAGE_NOW=3405000
    POWER_SUPPLY_CURRENT_NOW=4000
    POWER_SUPPLY_CAPACITY=28
    POWER_SUPPLY_CAPACITY_LEVEL=Normal
    POWER_SUPPLY_TEMP=259
    POWER_SUPPLY_TIME_TO_EMPTY_NOW=1611000
    POWER_SUPPLY_TECHNOLOGY=Li-ion
    POWER_SUPPLY_CHARGE_FULL=6494000
    POWER_SUPPLY_CHARGE_FULL_DESIGN=6000000
    POWER_SUPPLY_CYCLE_COUNT=1
    POWER_SUPPLY_ENERGY_NOW=0
    POWER_SUPPLY_POWER_AVG=65535
    POWER_SUPPLY_HEALTH=Good
    POWER_SUPPLY_MANUFACTURER=Texas Instruments

TEST CASE II : discharging current =0:
    POWER_SUPPLY_NAME=bq78z100-0
    POWER_SUPPLY_STATUS=Discharging
    POWER_SUPPLY_PRESENT=1
    POWER_SUPPLY_VOLTAGE_NOW=3405000
    POWER_SUPPLY_CURRENT_NOW=0
    POWER_SUPPLY_CAPACITY=28
    POWER_SUPPLY_CAPACITY_LEVEL=Normal
    POWER_SUPPLY_TEMP=260
    POWER_SUPPLY_TECHNOLOGY=Li-ion
    POWER_SUPPLY_CHARGE_FULL=6494000
    POWER_SUPPLY_CHARGE_FULL_DESIGN=6000000
    POWER_SUPPLY_CYCLE_COUNT=1
    POWER_SUPPLY_ENERGY_NOW=0
    POWER_SUPPLY_POWER_AVG=0
    POWER_SUPPLY_HEALTH=Good
    POWER_SUPPLY_MANUFACTURER=Texas Instruments



Best Regards

Li Qingwu (Terry)


Best Regards

Li Qingwu (Terry)




-----Original Message-----
From: Sebastian Reichel <sre@kernel.org> 
Sent: Monday, March 15, 2021 7:42 AM
To: LI Qingwu <qing-wu.li@leica-geosystems.com.cn>
Cc: robh+dt@kernel.org; pali@kernel.org; krzk@kernel.org; afd@ti.com; linux-pm@vger.kernel.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; TERTYCHNYI Grygorii <grygorii.tertychnyi@leica-geosystems.com>; ZHIZHIKIN Andrey <andrey.zhizhikin@leica-geosystems.com>
Subject: Re: [PATCH V5 0/2] power: bq27xxx: add bq78z100

Hi,

On Fri, Mar 05, 2021 at 06:49:47AM +0000, LI Qingwu wrote:
> Changes in V5:
> 
> 1. Change [BQ27XXX_REG_TTES] from INVALID_REG_ADDR to 0x1c, the 
> StandbyTimeToEmpty command of bq78z100.
> 2. Add [BQ27XXX_REG_RC] = 0x10. the RemainingCapacity command of 
> bq78z100.
> 3. Set [BQ27XXX_REG_AE] to INVALID_REG_ADDR, support by bq78z100.
> 4. Delete property POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, not support by 
> bq78z100

I also asked to check other exposed properties and to provide a dump of the power-supply uevent in commit message or cover letter to verify chip works as expected. I cannot see the dump and you are exposing at least one property that always reports -ENODATA. I intentionally will not point out the exact property, so that you have to properly test your patch before submitting.

Thanks,

-- Sebastian

> LI Qingwu (2):
>   dt-bindings: power: bq27xxx: add bq78z100
>   power: supply: bq27xxx: Add support for BQ78Z100
> 
>  .../bindings/power/supply/bq27xxx.yaml        |  1 +
>  drivers/power/supply/bq27xxx_battery.c        | 44 +++++++++++++++++++
>  drivers/power/supply/bq27xxx_battery_i2c.c    |  2 +
>  include/linux/power/bq27xxx_battery.h         |  1 +
>  4 files changed, 48 insertions(+)
> 
> --
> 2.17.1
>