[Letux-kernel] [PATCH] power: supply: bq27xxx: do not report bogus zero values

H. Nikolaus Schaller hns at goldelico.com
Thu Mar 13 08:28:35 CET 2025


Hi Sicelo,
please can you append the patch to the e-mail as usual?

Then "git am" can easily be applied or it can be found in patchwork.

BR and thanks,
Nikolaus

> Am 12.03.2025 um 13:28 schrieb Sicelo <absicsz at gmail.com>:
> 
> Hi Nikolaus
> 
> On Fri, Feb 28, 2025 at 11:01:35AM +0100, H. Nikolaus Schaller wrote:
>>> 
>>> Thanks for the review. I will do more thorough testing over the weekend
>>> and send the patch.
> 
> I have made a follow-up patch [0], which produces the following values
> on the N900:
> 
> bq27200 in 'normal' state:
> 
>   DEVTYPE=power_supply
>   OF_NAME=bq27200
>   OF_FULLNAME=/ocp at 68000000/i2c at 48072000/bq27200 at 55
>   OF_COMPATIBLE_0=ti,bq27200
>   OF_COMPATIBLE_N=1
>   POWER_SUPPLY_NAME=bq27200-0
>   POWER_SUPPLY_TYPE=Battery
>   POWER_SUPPLY_STATUS=Discharging
>   POWER_SUPPLY_HEALTH=Calibration required
>   POWER_SUPPLY_PRESENT=1
>   POWER_SUPPLY_TECHNOLOGY=Li-ion
>   POWER_SUPPLY_CYCLE_COUNT=0
>   POWER_SUPPLY_VOLTAGE_MAX_DESIGN=4064000
>   POWER_SUPPLY_VOLTAGE_MIN_DESIGN=3000000
>   POWER_SUPPLY_VOLTAGE_NOW=3536000
>   POWER_SUPPLY_CURRENT_NOW=-432327
>   POWER_SUPPLY_POWER_AVG=1146100
>   POWER_SUPPLY_CHARGE_FULL_DESIGN=2056320
>   POWER_SUPPLY_CHARGE_FULL=2050560
>   POWER_SUPPLY_CHARGE_NOW=366680
>   POWER_SUPPLY_ENERGY_NOW=1207420
>   POWER_SUPPLY_CAPACITY=18
>   POWER_SUPPLY_CAPACITY_LEVEL=Normal
>   POWER_SUPPLY_TEMP=316
>   POWER_SUPPLY_TIME_TO_EMPTY_NOW=4140
>   POWER_SUPPLY_TIME_TO_EMPTY_AVG=3780
>   POWER_SUPPLY_TYPE=Battery
>   POWER_SUPPLY_MANUFACTURER=Texas Instruments
> 
> bq27200 in 'broken' state:
> 
>   DEVTYPE=power_supply
>   OF_NAME=bq27200
>   OF_FULLNAME=/ocp at 68000000/i2c at 48072000/bq27200 at 55
>   OF_COMPATIBLE_0=ti,bq27200
>   OF_COMPATIBLE_N=1
>   POWER_SUPPLY_NAME=bq27200-0
>   POWER_SUPPLY_TYPE=Battery
>   POWER_SUPPLY_STATUS=Discharging
>   POWER_SUPPLY_HEALTH=Calibration required
>   POWER_SUPPLY_PRESENT=1
>   POWER_SUPPLY_TECHNOLOGY=Li-ion
>   POWER_SUPPLY_CYCLE_COUNT=0
>   POWER_SUPPLY_VOLTAGE_MAX_DESIGN=4064000
>   POWER_SUPPLY_VOLTAGE_MIN_DESIGN=3000000
>   POWER_SUPPLY_VOLTAGE_NOW=3633000
>   POWER_SUPPLY_CURRENT_NOW=-397341
>   POWER_SUPPLY_POWER_AVG=1432260
>   POWER_SUPPLY_CHARGE_FULL_DESIGN=2056320
>   POWER_SUPPLY_CHARGE_FULL=2050560
>   POWER_SUPPLY_CAPACITY_LEVEL=Normal
>   POWER_SUPPLY_TEMP=299
>   POWER_SUPPLY_TYPE=Battery
>   POWER_SUPPLY_MANUFACTURER=Texas Instruments
> 
> 
> Hope this also works fine on your devices.
> 
> Thanks and Regards
> Sicelo
> 
> 
> 
> [0] https://lore.kernel.org/linux-pm/20250312121712.146109-1-absicsz@gmail.com/T/#t



More information about the Letux-kernel mailing list