Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: uclogic: Add battery quirk

Some UGEE v2 tablets have a wireless version with an internal battery
and their firmware is able to report their battery level.

However, there was not found a field on their descriptor indicating
whether the tablet has battery or not, making it mandatory to classify
such devices through the UCLOGIC_BATTERY_QUIRK quirk.

Tested-by: Mia Kanashi <chad@redpilled.dev>
Tested-by: Andreas Grosse <andig.mail@t-online.de>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

José Expósito and committed by
Jiri Kosina
f60c377f 14b71e6a

+6
+5
drivers/hid/hid-uclogic-params.c
··· 1222 1222 */ 1223 1223 static bool uclogic_params_ugee_v2_has_battery(struct hid_device *hdev) 1224 1224 { 1225 + struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); 1226 + 1227 + if (drvdata->quirks & UCLOGIC_BATTERY_QUIRK) 1228 + return true; 1229 + 1225 1230 /* The XP-PEN Deco LW vendor, product and version are identical to the 1226 1231 * Deco L. The only difference reported by their firmware is the product 1227 1232 * name. Add a quirk to support battery reporting on the wireless
+1
drivers/hid/hid-uclogic-params.h
··· 20 20 #include <linux/hid.h> 21 21 22 22 #define UCLOGIC_MOUSE_FRAME_QUIRK BIT(0) 23 + #define UCLOGIC_BATTERY_QUIRK BIT(1) 23 24 24 25 /* Types of pen in-range reporting */ 25 26 enum uclogic_params_pen_inrange {