Commit 3f87baac authored by Kornel Dulęba's avatar Kornel Dulęba Committed by Sebastian Reichel
Browse files

power: supply: qcom_battmgr: Report battery capacity



Battery charge can be reported in several different ways. One of them is
is charge percentage referred to as POWER_SUPPLY_PROP_CAPACITY in the
power supply API. Currently the driver reports the capacity in this way
on SM8350, but not on the newer variants referred to as SC8280XP in the
driver. Although this is not a bug in itself, not reporting the
percentage can confuse some userspace consumers.
Mimic what is done in the ACPI driver (drivers/acpi/battery.c) and
calculate the percentage capacity by dividing the current charge value
by the full charge.

Signed-off-by: default avatarKornel Dulęba <korneld@google.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250528112328.1640743-2-korneld@google.com


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 6aa1c3a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment