File tree Expand file tree Collapse file tree 4 files changed +59
-0
lines changed Expand file tree Collapse file tree 4 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -1077,6 +1077,12 @@ config HID_TOPSEED
1077
1077
Say Y if you have a TopSeed Cyberlink or BTC Emprex or Conceptronic
1078
1078
CLLRCMCE remote control.
1079
1079
1080
+ config HID_TOPRE
1081
+ tristate "Topre REALFORCE keyboards"
1082
+ depends on HID
1083
+ help
1084
+ Say Y for N-key rollover support on Topre REALFORCE R2 108 key keyboards.
1085
+
1080
1086
config HID_THINGM
1081
1087
tristate "ThingM blink(1) USB RGB LED"
1082
1088
depends on LEDS_CLASS
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o
123
123
obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o hid-thrustmaster.o
124
124
obj-$(CONFIG_HID_TIVO) += hid-tivo.o
125
125
obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
126
+ obj-$(CONFIG_HID_TOPRE) += hid-topre.o
126
127
obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o
127
128
obj-$(CONFIG_HID_U2FZERO) += hid-u2fzero.o
128
129
hid-uclogic-objs := hid-uclogic-core.o \
Original file line number Diff line number Diff line change 1231
1231
#define USB_DEVICE_ID_TIVO_SLIDE 0x1201
1232
1232
#define USB_DEVICE_ID_TIVO_SLIDE_PRO 0x1203
1233
1233
1234
+ #define USB_VENDOR_ID_TOPRE 0x0853
1235
+ #define USB_DEVICE_ID_TOPRE_REALFORCE_R2_108 0x0148
1236
+
1234
1237
#define USB_VENDOR_ID_TOPSEED 0x0766
1235
1238
#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204
1236
1239
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-2.0+
2
+ /*
3
+ * HID driver for Topre REALFORCE Keyboards
4
+ *
5
+ * Copyright (c) 2022 Harry Stern <[email protected] >
6
+ *
7
+ * Based on the hid-macally driver
8
+ */
9
+
10
+ #include <linux/hid.h>
11
+ #include <linux/module.h>
12
+
13
+ #include "hid-ids.h"
14
+
15
+ MODULE_AUTHOR (
"Harry Stern <[email protected] >" );
16
+ MODULE_DESCRIPTION ("REALFORCE R2 Keyboard driver" );
17
+ MODULE_LICENSE ("GPL" );
18
+
19
+ /*
20
+ * Fix the REALFORCE R2's non-boot interface's report descriptor to match the
21
+ * events it's actually sending. It claims to send array events but is instead
22
+ * sending variable events.
23
+ */
24
+ static __u8 * topre_report_fixup (struct hid_device * hdev , __u8 * rdesc ,
25
+ unsigned int * rsize )
26
+ {
27
+ if (* rsize >= 119 && rdesc [69 ] == 0x29 && rdesc [70 ] == 0xe7 &&
28
+ rdesc [71 ] == 0x81 && rdesc [72 ] == 0x00 ) {
29
+ hid_info (hdev ,
30
+ "fixing up Topre REALFORCE keyboard report descriptor\n" );
31
+ rdesc [72 ] = 0x02 ;
32
+ }
33
+ return rdesc ;
34
+ }
35
+
36
+ static const struct hid_device_id topre_id_table [] = {
37
+ { HID_USB_DEVICE (USB_VENDOR_ID_TOPRE ,
38
+ USB_DEVICE_ID_TOPRE_REALFORCE_R2_108 ) },
39
+ { }
40
+ };
41
+ MODULE_DEVICE_TABLE (hid , topre_id_table );
42
+
43
+ static struct hid_driver topre_driver = {
44
+ .name = "topre" ,
45
+ .id_table = topre_id_table ,
46
+ .report_fixup = topre_report_fixup ,
47
+ };
48
+
49
+ module_hid_driver (topre_driver );
You can’t perform that action at this time.
0 commit comments