Skip to content

Commit f60c377

Browse files
JoseExpositoJiri Kosina
authored andcommitted
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 <[email protected]> Tested-by: Andreas Grosse <[email protected]> Signed-off-by: José Expósito <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 14b71e6 commit f60c377

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/hid/hid-uclogic-params.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,11 @@ static int uclogic_params_ugee_v2_init_frame_mouse(struct uclogic_params *p)
12221222
*/
12231223
static bool uclogic_params_ugee_v2_has_battery(struct hid_device *hdev)
12241224
{
1225+
struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
1226+
1227+
if (drvdata->quirks & UCLOGIC_BATTERY_QUIRK)
1228+
return true;
1229+
12251230
/* The XP-PEN Deco LW vendor, product and version are identical to the
12261231
* Deco L. The only difference reported by their firmware is the product
12271232
* name. Add a quirk to support battery reporting on the wireless

drivers/hid/hid-uclogic-params.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/hid.h>
2121

2222
#define UCLOGIC_MOUSE_FRAME_QUIRK BIT(0)
23+
#define UCLOGIC_BATTERY_QUIRK BIT(1)
2324

2425
/* Types of pen in-range reporting */
2526
enum uclogic_params_pen_inrange {

0 commit comments

Comments
 (0)