From: Ed Robbins <edd.robbins@googlemail.com>
To: linux-pm@vger.kernel.org
Cc: sre@kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] pmu_battery: Set power supply type to BATTERY
Date: Fri, 18 Oct 2024 07:07:30 +0100 [thread overview]
Message-ID: <IOFJLS.120OJ5KJG9R72@googlemail.com> (raw)
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
next reply other threads:[~2024-10-18 8:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 6:07 Ed Robbins [this message]
2024-11-11 22:13 ` [PATCH] pmu_battery: Set power supply type to BATTERY Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=IOFJLS.120OJ5KJG9R72@googlemail.com \
--to=edd.robbins@googlemail.com \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).