* [PATCH] power: supply: qcom_battmgr: Report capacity on X1E80100
@ 2026-09-20 19:34 Liviu Nicoara
2026-09-21 8:56 ` Konrad Dybcio
0 siblings, 1 reply; 2+ messages in thread
From: Liviu Nicoara @ 2026-09-20 19:34 UTC (permalink / raw)
To: Sebastian Reichel; +Cc: linux-pm, linux-arm-msm, linux-kernel, Liviu Nicoara
Commit 3f87baacea4d ("power: supply: qcom_battmgr: Report battery
capacity") added POWER_SUPPLY_PROP_CAPACITY to the SC8280XP battery
properties, computed from the firmware's charge and last-full values.
When commit cc3e883a0625 ("power: supply: qcom_battmgr: Add charge
control support") later gave X1E80100 a property table of its own, the
table was copied without the capacity property, so X1E80100 machines
expose energy_now and energy_full but no capacity.
The percentage is already computed for this variant in the shared
SC8280XP callback; only the property list is missing it. Add it, in the
same place it sits in the SC8280XP table.
Tested on a Dell XPS 13 9345: capacity reads 94 with energy_now
52640000 and energy_full 55540000.
Fixes: cc3e883a0625 ("power: supply: qcom_battmgr: Add charge control support")
Signed-off-by: Liviu Nicoara <lnicoara@thinkoid.org>
---
drivers/power/supply/qcom_battmgr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index 7716eb9e1..a7237ba09 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -830,6 +830,7 @@ static const enum power_supply_property x1e80100_bat_props[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_TECHNOLOGY,
+ POWER_SUPPLY_PROP_CAPACITY,
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] power: supply: qcom_battmgr: Report capacity on X1E80100
2026-09-20 19:34 [PATCH] power: supply: qcom_battmgr: Report capacity on X1E80100 Liviu Nicoara
@ 2026-09-21 8:56 ` Konrad Dybcio
0 siblings, 0 replies; 2+ messages in thread
From: Konrad Dybcio @ 2026-09-21 8:56 UTC (permalink / raw)
To: Liviu Nicoara, Sebastian Reichel; +Cc: linux-pm, linux-arm-msm, linux-kernel
On 9/20/26 9:34 PM, Liviu Nicoara wrote:
> Commit 3f87baacea4d ("power: supply: qcom_battmgr: Report battery
> capacity") added POWER_SUPPLY_PROP_CAPACITY to the SC8280XP battery
> properties, computed from the firmware's charge and last-full values.
> When commit cc3e883a0625 ("power: supply: qcom_battmgr: Add charge
> control support") later gave X1E80100 a property table of its own, the
> table was copied without the capacity property, so X1E80100 machines
> expose energy_now and energy_full but no capacity.
>
> The percentage is already computed for this variant in the shared
> SC8280XP callback; only the property list is missing it. Add it, in the
> same place it sits in the SC8280XP table.
>
> Tested on a Dell XPS 13 9345: capacity reads 94 with energy_now
> 52640000 and energy_full 55540000.
>
> Fixes: cc3e883a0625 ("power: supply: qcom_battmgr: Add charge control support")
> Signed-off-by: Liviu Nicoara <lnicoara@thinkoid.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-21 8:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20 19:34 [PATCH] power: supply: qcom_battmgr: Report capacity on X1E80100 Liviu Nicoara
2026-09-21 8:56 ` Konrad Dybcio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®