Re: [PATCH] power: supply: qcom_battmgr: report full batteries

From: Konrad Dybcio

Date: Tue Oct 13 2026 - 07:29:11 EST


On 10/8/26 11:14 AM, Bjorn Andersson wrote:
> The SC8280XP battery-status response has no explicit full state. When a
> battery reaches its full capacity on external power, neither the charging
> nor discharging bit is set. The driver consequently reports "Not
> charging", which can make userspace show the system as battery powered.
>
> Use the response's power-online bit and the reported capacity to identify
> a battery that is full while externally powered. Preserve "Not charging"
> for a battery whose charging is inhibited below its full capacity.

Let's define that bit, as it's not obvious what it corresponds to.

>
> Fixes: 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply")
> Assisted-by: LLM
> Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>
> ---
> drivers/power/supply/qcom_battmgr.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
> index 7716eb9e1aff..97cbe966ea84 100644
> --- a/drivers/power/supply/qcom_battmgr.c
> +++ b/drivers/power/supply/qcom_battmgr.c
> @@ -1261,6 +1261,7 @@ static void qcom_battmgr_sc8280xp_callback(struct qcom_battmgr *battmgr,
> unsigned int opcode = le32_to_cpu(resp->hdr.opcode);
> unsigned int source;
> unsigned int state;
> + unsigned int power_state;

Reverse-Christmas-tree, please

Claude also has concerns regarding how this interacts with charge
limit (although perhaps "not charging" should be good there?)

with that resolved:

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad