Re: [PATCH 2/2] power: supply: qcom_battmgr: expose the charge current limit
From: joonhoekim
Date: Tue Oct 20 2026 - 09:29:25 EST
From: Joonhoe Kim <26rote@xxxxxxxxx>
On 10/20/26 11:55 AM, Konrad Dybcio wrote:
>> + mutex_lock(&battmgr->lock);
>
> guard(mutex)(&battmgr->lock)
Will do.
>> + if (!ret) {
>
> LLM suggests to add:
>
> - if (!ret) {
> + if (!ret && !battmgr->info.charge_ctrl_limit_max)
> + ret = -ENODATA;
> + if (!ret) {
>
> to prevent a possible zero-maximum value coming from the FW
> from messing with us here
Agreed. This firmware reports a maximum of 12.4 A, but a zero maximum
would clamp every write to 0, and a limit of 0 stops charging here until
the end threshold is moved below the capacity and back. Returning
-ENODATA is better than that.
Both in v2. I'll wait until Jingyi has had a chance to check the sign
in 1/2, then resend the two together.
Thanks,
Joonhoe Kim