hms(4): Disable vendor usage page button support

for all devices except Kensington Slimblade Trackball as it brokes
some other devices like Contour Rollermouse Red

Add a quirk for it as well.

Reported by:	Atte Peltomäki <koston_AT_iki_DOT_fi>
PR:		267922
MFC after:	2 weeks
This commit is contained in:
Vladimir Kondratyev 2022-12-24 12:01:20 +03:00
parent ab4f740bc5
commit 0661cf74e6
4 changed files with 13 additions and 4 deletions

View File

@ -53,6 +53,8 @@ doesn't identify properly
mouse sends an unknown leading byte
.It HQ_MS_REVZ
mouse has Z-axis reversed
.It HQ_MS_VENDOR_BTN
mouse has buttons in vendor usage page
.It HQ_SPUR_BUT_UP
spurious mouse button up events
.It HQ_MT_TIMESTAMP

View File

@ -151,6 +151,8 @@ static struct hidquirk_entry hidquirks[HID_DEV_QUIRKS_MAX] = {
USB_QUIRK(CORSAIR, STRAFE2, 0x0000, 0xffff, HQ_KBD_BOOTPROTO),
/* Holtek USB gaming keyboard */
USB_QUIRK(HOLTEK, F85, 0x0000, 0xffff, HQ_KBD_BOOTPROTO),
/* Quirk for Kensington Slimblade Trackball */
USB_QUIRK(KENSINGTON, SLIMBLADE, 0x0000, 0xffff, HQ_MS_VENDOR_BTN),
};
#undef HID_QUIRK_VP
#undef USB_QUIRK

View File

@ -59,6 +59,7 @@
HQ(MS_BAD_CLASS), /* doesn't identify properly */ \
HQ(MS_LEADING_BYTE), /* mouse sends an unknown leading byte */ \
HQ(MS_REVZ), /* mouse has Z-axis reversed */ \
HQ(MS_VENDOR_BTN), /* mouse has buttons in vendor usage page */ \
HQ(SPUR_BUT_UP), /* spurious mouse button up events */ \
HQ(MT_TIMESTAMP) /* Multitouch device exports HW timestamps */

View File

@ -61,8 +61,6 @@ enum {
HMS_ABS_Z,
HMS_HWHEEL,
HMS_BTN,
HMS_BTN_MS1,
HMS_BTN_MS2,
HMS_FINAL_CB,
};
@ -95,8 +93,6 @@ static const struct hidmap_item hms_map[] = {
[HMS_ABS_Z] = HMS_MAP_ABS(HUG_Z, ABS_Z),
[HMS_HWHEEL] = HMS_MAP_REL_CN(HUC_AC_PAN, REL_HWHEEL),
[HMS_BTN] = HMS_MAP_BUT_RG(1, 16, BTN_MOUSE),
[HMS_BTN_MS1] = HMS_MAP_BUT_MS(1, BTN_RIGHT),
[HMS_BTN_MS2] = HMS_MAP_BUT_MS(2, BTN_MIDDLE),
[HMS_FINAL_CB] = HMS_FINAL_CB(hms_final_cb),
};
@ -107,6 +103,11 @@ static const struct hidmap_item hms_map_wheel_rev[] = {
HMS_MAP_REL_REV(HUG_WHEEL, REL_WHEEL),
};
static const struct hidmap_item hms_map_kensington_slimblade[] = {
HMS_MAP_BUT_MS(1, BTN_RIGHT),
HMS_MAP_BUT_MS(2, BTN_MIDDLE),
};
/* A match on these entries will load hms */
static const struct hid_device_id hms_devs[] = {
{ HID_TLC(HUP_GENERIC_DESKTOP, HUG_POINTER) },
@ -261,6 +262,9 @@ hms_attach(device_t dev)
else
HIDMAP_ADD_MAP(&sc->hm, hms_map_wheel, cap_wheel);
if (hid_test_quirk(hw, HQ_MS_VENDOR_BTN))
HIDMAP_ADD_MAP(&sc->hm, hms_map_kensington_slimblade, NULL);
#ifdef IICHID_SAMPLING
if (hid_test_quirk(hw, HQ_IICHID_SAMPLING) &&
hidmap_test_cap(sc->caps, HMS_REL_X) &&