Skip to contentSkip to conversation

pmu_battery: Set power supply type to BATTERY

PATCH Applied Ed Robbins 2 participants 2 messages Oct 18, 2024 – Nov 11, 2024 Power supply

lore
Share & tools
lore

Ed Robbins

author
#0 lore raw

PATCH 1/1 pmu_battery: Set power supply type to BATTERY

If the power supply type is not set it defaults to "Unknown" and upower does not recognise it. In turn battery monitor applications do not see a battery. Setting to POWER_SUPPLY_TYPE_BATTERY fixes this.

---
drivers/power/supply/pmu_battery.c | 1 +

1 file changed, 1 insertion(+)
drivers/power/supply/pmu_battery.c +0 -0
index eaab7500d9..ed83c5e05c 100644
@@ -170,6 +170,7 @@ static int __init pmu_bat_init(void)
		pbat->bat_desc.properties = pmu_bat_props;
		pbat->bat_desc.num_properties = ARRAY_SIZE(pmu_bat_props);
		pbat->bat_desc.get_property = pmu_bat_get_property;
+		pbat->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY;
		pbat->pbi = &pmu_batteries[i];
		psy_cfg.drv_data = pbat;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Ed Robbins

If the power supply type is not set it defaults to "Unknown" and upower does not recognise it. In turn battery monitor applications do not see a battery. Setting to POWER_SUPPLY_TYPE_BATTERY fixes this.

Applied, thanks!

[1/1] pmu_battery: Set power supply type to BATTERY

      commit: 3287673c1d26f94845ef958090c583c46054b70d

Best regards,

Signature · 1 line
Sebastian Reichel <[email protected]>