Skip to contentSkip to conversation

HID: hid-input: Extend Elan ignore battery quirk to USB

PATCH In review Mario Limonciello (AMD) 4 participants 5 messages Oct 30, 2025 – Nov 6, 2025 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: hid-input: Extend Elan ignore battery quirk to USB

USB Elan devices have the same problem as the I2C ones with a fake battery device showing up.

---
 drivers/hid/hid-input.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hid/hid-input.c +3 -2
index e56e7de532799..2bbb645c2ff41 100644
@@ -399,10 +399,11 @@ static const struct hid_device_id hid_battery_quirks[] = {
 	{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_CHROMEBOOK_TROGDOR_POMPOM),
 	  HID_BATTERY_QUIRK_AVOID_QUERY },
 	/*
-	 * Elan I2C-HID touchscreens seem to all report a non present battery,
-	 * set HID_BATTERY_QUIRK_IGNORE for all Elan I2C-HID devices.
+	 * Elan HID touchscreens seem to all report a non present battery,
+	 * set HID_BATTERY_QUIRK_IGNORE for all Elan I2C and USB HID devices.
 	 */
 	{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_BATTERY_QUIRK_IGNORE },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_BATTERY_QUIRK_IGNORE },
 	{}
 };
 
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 7 lines · Mario Limonciello (AMD)

USB Elan devices have the same problem as the I2C ones with a fake battery device showing up.

Now applied.

We'll have to come up with something more sophisticated once/if Elan ever starts producing devices with real battery ...

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#2 lore raw

Hi Jiri,

Quoted 10 lines · Jiri Kosina
Quoted 7 lines · Mario Limonciello (AMD)

USB Elan devices have the same problem as the I2C ones with a fake battery device showing up.

Quoted 4 lines

Now applied.

We'll have to come up with something more sophisticated once/if Elan ever starts producing devices with real battery ...

Actually the provided HID battery is intended to be for when a stylus is used and to report the stylus battery values then.

There is an email thread somewhere with some of the ChromeOS folks talking about dropping the ELAN quirk for I2C touchscreens and indeed replacing it with something more sophisticated. IIRC the ChromeOS folks mentioned they would work on / provide patches.

+To: Dmitry, Dmitry do you have any input on the ChromeOs issue ?

In the mean time I do believe these quirks are the lesser of 2 evils. Most people don't have a stylus (which is typically not bundled with these devices) and even if people have a stylus not having battery reporting for that is less of a problem then the false positive low-battery *notifications* which e.g. GNOME shows due to the battery reporting 0% (rather then not present) when there is no stylus.

Regards,

Hans

#3 lore raw

Hi Hans,

Quoted 23 lines · Hans de Goede

Hi Jiri,

Quoted 10 lines · Jiri Kosina
Quoted 7 lines · Mario Limonciello (AMD)

USB Elan devices have the same problem as the I2C ones with a fake battery device showing up.

Quoted 4 lines

Now applied.

We'll have to come up with something more sophisticated once/if Elan ever starts producing devices with real battery ...

Actually the provided HID battery is intended to be for when a stylus is used and to report the stylus battery values then.

Quoted 6 lines

There is an email thread somewhere with some of the ChromeOS folks talking about dropping the ELAN quirk for I2C touchscreens and indeed replacing it with something more sophisticated. IIRC the ChromeOS folks mentioned they would work on / provide patches.

+To: Dmitry, Dmitry do you have any input on the ChromeOs issue ?

+Kenneth Albanowski has been wrangling with support of Elan and other vendor styli, I'll let him comment.

Quoted 8 lines

In the mean time I do believe these quirks are the lesser of 2 evils. Most people don't have a stylus (which is typically not bundled with these devices) and even if people have a stylus not having battery reporting for that is less of a problem then the false positive low-battery *notifications* which e.g. GNOME shows due to the battery reporting 0% (rather then not present) when there is no stylus.

Thanks,
Dmitry

#4 lore raw
Quoted 32 lines · Dmitry Torokhov

Hi Hans,

Quoted 28 lines · Hans de Goede

Hi Jiri,

Quoted 10 lines · Jiri Kosina
Quoted 7 lines · Mario Limonciello (AMD)

USB Elan devices have the same problem as the I2C ones with a fake battery device showing up.

Quoted 4 lines

Now applied.

We'll have to come up with something more sophisticated once/if Elan ever starts producing devices with real battery ...

Actually the provided HID battery is intended to be for when a stylus is used and to report the stylus battery values then.

There is an email thread somewhere with some of the ChromeOS folks talking about dropping the ELAN quirk for I2C touchscreens and indeed replacing it with something more sophisticated. IIRC the ChromeOS folks mentioned they would work on / provide patches.

Quoted 4 lines
Quoted 1 line

+To: Dmitry, Dmitry do you have any input on the ChromeOs issue ?

+Kenneth Albanowski has been wrangling with support of Elan and other vendor styli, I'll let him comment.

Kenneth is currently busy with some internal projects and asked me to pass the following:

We recommend that userspace components do not generate alerts for power supplies that report "status" as "unknown". For a lot of styli we start with "unknown" and 0 level until after we get a first real report and update the state to "discharging" or "full" and only hen we may start showing the indicator.

On ChromeOS we also have tech for clarifying "1%" and other bad reports, currently specific to USI styluses using a S/N filter.

Kenneth will try to share more details next week hopefully.

Thanks,
Dmitry