Skip to content

Commit 9271af9

Browse files
helpvisaJiri Kosina
authored andcommitted
HID: topre: Fix n-key rollover on Realforce R3S TKL boards
Newer model R3* Topre Realforce keyboards share an issue with their older R2 cousins where a report descriptor fixup is needed in order for n-key rollover to work correctly, otherwise only 6-key rollover is available. This patch adds some new hardware IDs for the R3S 87-key keyboard and makes amendments to the existing hid-topre driver in order to change the correct byte in the new model. Signed-off-by: Daniel Brackenbury <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 18c966b commit 9271af9

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

drivers/hid/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,8 @@ config HID_TOPRE
11691169
tristate "Topre REALFORCE keyboards"
11701170
depends on HID
11711171
help
1172-
Say Y for N-key rollover support on Topre REALFORCE R2 108/87 key keyboards.
1172+
Say Y for N-key rollover support on Topre REALFORCE R2 108/87 key and
1173+
Topre REALFORCE R3S 87 key keyboards.
11731174

11741175
config HID_THINGM
11751176
tristate "ThingM blink(1) USB RGB LED"

drivers/hid/hid-ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,7 @@
13021302
#define USB_VENDOR_ID_TOPRE 0x0853
13031303
#define USB_DEVICE_ID_TOPRE_REALFORCE_R2_108 0x0148
13041304
#define USB_DEVICE_ID_TOPRE_REALFORCE_R2_87 0x0146
1305+
#define USB_DEVICE_ID_TOPRE_REALFORCE_R3S_87 0x0313
13051306

13061307
#define USB_VENDOR_ID_TOPSEED 0x0766
13071308
#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204

drivers/hid/hid-topre.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ static const __u8 *topre_report_fixup(struct hid_device *hdev, __u8 *rdesc,
2929
hid_info(hdev,
3030
"fixing up Topre REALFORCE keyboard report descriptor\n");
3131
rdesc[72] = 0x02;
32+
} else if (*rsize >= 106 && rdesc[28] == 0x29 && rdesc[29] == 0xe7 &&
33+
rdesc[30] == 0x81 && rdesc[31] == 0x00) {
34+
hid_info(hdev,
35+
"fixing up Topre REALFORCE keyboard report descriptor\n");
36+
rdesc[31] = 0x02;
3237
}
3338
return rdesc;
3439
}
@@ -38,6 +43,8 @@ static const struct hid_device_id topre_id_table[] = {
3843
USB_DEVICE_ID_TOPRE_REALFORCE_R2_108) },
3944
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPRE,
4045
USB_DEVICE_ID_TOPRE_REALFORCE_R2_87) },
46+
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPRE,
47+
USB_DEVICE_ID_TOPRE_REALFORCE_R3S_87) },
4148
{ }
4249
};
4350
MODULE_DEVICE_TABLE(hid, topre_id_table);

0 commit comments

Comments
 (0)