]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: input: Add HID_BATTERY_QUIRK_DYNAMIC for Elan touchscreens
authorHans de Goede <johannes.goede@oss.qualcomm.com>
Sat, 28 Feb 2026 14:52:58 +0000 (15:52 +0100)
committerJiri Kosina <jkosina@suse.com>
Wed, 11 Mar 2026 14:26:47 +0000 (15:26 +0100)
commit227312b4a65c373d5d8b4683b7fc36203fedc516
treea73d444b3d2bce2038f8f477c591a0a9ef3b1c19
parent487b23afaf4b258a70d3e4a8febf66f09850e75f
HID: input: Add HID_BATTERY_QUIRK_DYNAMIC for Elan touchscreens

Elan touchscreens have a HID-battery device for the stylus which is always
there even if there is no stylus.

This is causing upower to report an empty battery for the stylus and some
desktop-environments will show a notification about this, which is quite
annoying.

Because of this the HID-battery is being ignored on all Elan I2c and USB
touchscreens, but this causes there to be no battery reporting for
the stylus at all.

This adds a new HID_BATTERY_QUIRK_DYNAMIC and uses these for the Elan
touchscreens.

This new quirks causes the present value of the battery to start at 0,
which will make userspace ignore it and only sets present to 1 after
receiving a battery input report which only happens when the stylus
gets in range.

Reported-by: ggrundik@gmail.com
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221118
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-input.c
include/linux/hid.h