linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pmu_battery: Set power supply type to BATTERY
@ 2024-10-18  6:07 Ed Robbins
  2024-11-11 22:13 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Robbins @ 2024-10-18  6:07 UTC (permalink / raw)
  To: linux-pm; +Cc: sre, linuxppc-dev

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.

Signed-off-by: Ed Robbins <edd.robbins@gmail.com>
---
 drivers/power/supply/pmu_battery.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/supply/pmu_battery.c 
b/drivers/power/supply/pmu_battery.c
index eaab7500d9..ed83c5e05c 100644
--- a/drivers/power/supply/pmu_battery.c
+++ b/drivers/power/supply/pmu_battery.c
@@ -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;

-- 
2.34.1





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pmu_battery: Set power supply type to BATTERY
  2024-10-18  6:07 [PATCH] pmu_battery: Set power supply type to BATTERY Ed Robbins
@ 2024-11-11 22:13 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2024-11-11 22:13 UTC (permalink / raw)
  To: linux-pm, Ed Robbins; +Cc: sre, linuxppc-dev


On Fri, 18 Oct 2024 07:07:30 +0100, Ed Robbins wrote:
> 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,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-11 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18  6:07 [PATCH] pmu_battery: Set power supply type to BATTERY Ed Robbins
2024-11-11 22:13 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).