This source file includes following definitions.
- px_raw_event
1
2
3
4
5
6
7
8
9
10
11 #include <linux/device.h>
12 #include <linux/hid.h>
13 #include <linux/module.h>
14
15 #include "hid-ids.h"
16
17 static int px_raw_event(struct hid_device *hid, struct hid_report *report,
18 u8 *data, int size)
19 {
20 int idx = size;
21
22 switch (report->id) {
23 case 0:
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 while (--idx > 1) {
42 if (data[idx] < 0xE0 || data[idx] > 0xE7)
43 continue;
44 data[0] |= (1 << (data[idx] - 0xE0));
45 data[idx] = 0;
46 }
47 hid_report_raw_event(hid, HID_INPUT_REPORT, data, size, 0);
48 return 1;
49
50 default:
51
52 hid_info(hid, "unknown report type %d\n", report->id);
53 break;
54 }
55
56 return 0;
57 }
58
59 static const struct hid_device_id px_devices[] = {
60 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
61 { }
62 };
63 MODULE_DEVICE_TABLE(hid, px_devices);
64
65 static struct hid_driver px_driver = {
66 .name = "primax",
67 .id_table = px_devices,
68 .raw_event = px_raw_event,
69 };
70 module_hid_driver(px_driver);
71
72 MODULE_AUTHOR("Terry Lambert <tlambert@google.com>");
73 MODULE_LICENSE("GPL");