[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <q6zxkzuvczjuewapb5jrk6bnp3t6lsvu5mgqb7gpq7bbdsgprd@ozgvgbtapdjw>
Date: Wed, 28 May 2025 15:14:58 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Kornel Dulęba <korneld@...gle.com>
Cc: Sebastian Reichel <sre@...nel.org>, Bjorn Andersson <andersson@...nel.org>,
linux-arm-msm@...r.kernel.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] power: supply: qcom_battmgr: Report battery capacity
On Wed, May 28, 2025 at 11:23:29AM +0000, Kornel Dulęba wrote:
> 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: Kornel Dulęba <korneld@...gle.com>
> ---
> v2: Change the logic to avoid u64 division, which is problematic on
> 32bit platforms.
>
> drivers/power/supply/qcom_battmgr.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
--
With best wishes
Dmitry
Powered by blists - more mailing lists