diff mbox series

device type in apple-mfi-fastcharfe

Message ID b0b97178-80ec-65f9-9ae9-7f72ffc6af74@suse.com
State New
Headers show
Series device type in apple-mfi-fastcharfe | expand

Commit Message

Oliver Neukum April 7, 2022, 10:40 a.m. UTC
Hi,

looking at this bug report:

https://bugzilla.kernel.org/show_bug.cgi?id=215799

I had an occasion to look at the way it registers the charger.
In particular:
 .type                   = POWER_SUPPLY_TYPE_BATTERY,

That seems kind of wrong. It does not contain a battery, does it? The
type seems to confound user space. Is there some deeper reason? If not
how about the attached patch? Regards Oliver

Comments

Bastien Nocera April 7, 2022, 11:54 a.m. UTC | #1
On Thu, 2022-04-07 at 13:42 +0200, Benjamin Tissoires wrote:
> If the following patch doesn't break existing userspace and is the
> "correct" way of reporting battery, sure, why not.

Sent as a proper patch to linux-input, thanks!
diff mbox series

Patch

From e1e7805585a979f74ba86a407ca8246a51c47a97 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@suse.com>
Date: Tue, 5 Apr 2022 11:40:39 +0200
Subject: [PATCH] apple-mfi-fastcharge: correct type

This is a charger, not a battery.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/misc/apple-mfi-fastcharge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c
index ac8695195c13..b8b394df622f 100644
--- a/drivers/usb/misc/apple-mfi-fastcharge.c
+++ b/drivers/usb/misc/apple-mfi-fastcharge.c
@@ -157,7 +157,7 @@  static enum power_supply_property apple_mfi_fc_properties[] = {
 
 static const struct power_supply_desc apple_mfi_fc_desc = {
 	.name                   = "apple_mfi_fastcharge",
-	.type                   = POWER_SUPPLY_TYPE_BATTERY,
+	.type                   = POWER_SUPPLY_TYPE_USB,
 	.properties             = apple_mfi_fc_properties,
 	.num_properties         = ARRAY_SIZE(apple_mfi_fc_properties),
 	.get_property           = apple_mfi_fc_get_property,
-- 
2.34.1