linux_dsm_epyc7002/include/linux/power
Matthias Schiffer 8ff0d8a090 power: supply: bq27xxx: fix power_avg for newer ICs
[ Upstream commit c4d57c22ac65bd503716062a06fad55a01569cac ]

On all newer bq27xxx ICs, the AveragePower register contains a signed
value; in addition to handling the raw value as unsigned, the driver
code also didn't convert it to µW as expected.

At least for the BQ28Z610, the reference manual incorrectly states that
the value is in units of 1mW and not 10mW. I have no way of knowing
whether the manuals of other supported ICs contain the same error, or if
there are models that actually use 1mW. At least, the new code shouldn't
be *less* correct than the old version for any device.

power_avg is removed from the cache structure, se we don't have to
extend it to store both a signed value and an error code. Always getting
an up-to-date value may be desirable anyways, as it avoids inconsistent
current and power readings when switching between charging and
discharging.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-11 14:47:24 +02:00
..
ab8500.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 197 2019-05-30 11:29:22 -07:00
bq27xxx_battery.h power: supply: bq27xxx: fix power_avg for newer ICs 2021-05-11 14:47:24 +02:00
bq2415x_charger.h power: fix duplicated words in bq2415x_charger.h 2020-07-27 00:10:14 +02:00
bq24190_charger.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
bq24735-charger.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
charger-manager.h power: supply: charger-manager: Update extcon functions 2020-08-28 19:27:45 +02:00
generic-adc-battery.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
gpio-charger.h power: supply: gpio-charger: Convert to GPIO descriptors 2020-08-27 16:47:14 +02:00
jz4740-battery.h
max8903_charger.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
max17042_battery.h power: supply: max17042: add MAX17055 support 2019-12-19 01:07:53 +01:00
sbs-battery.h
smartreflex.h ARM: OMAP2+: SmartReflex: add omap_sr_pdata definition 2019-11-13 11:33:53 +01:00
twl4030_madc_battery.h