1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#include <linux/device.h>
16#include <linux/hid.h>
17#include <linux/module.h>
18
19#include "hid-ids.h"
20
21
22#define PD1011_RDESC_ORIG_SIZE 408
23
24
25static __u8 pd1011_rdesc_fixed[] = {
26 0x05, 0x0D,
27 0x09, 0x02,
28 0xA1, 0x01,
29 0x85, 0x02,
30 0x09, 0x20,
31 0xA0,
32 0x75, 0x10,
33 0x95, 0x01,
34 0xA4,
35 0x05, 0x01,
36 0x65, 0x13,
37 0x55, 0xFD,
38 0x34,
39 0x09, 0x30,
40 0x46, 0x5D, 0x21,
41 0x27, 0x80, 0xA9,
42 0x00, 0x00,
43 0x81, 0x02,
44 0x09, 0x31,
45 0x46, 0xDA, 0x14,
46 0x26, 0xF0, 0x69,
47 0x81, 0x02,
48 0xB4,
49 0x14,
50 0x25, 0x01,
51 0x75, 0x01,
52 0x95, 0x01,
53 0x81, 0x03,
54 0x09, 0x32,
55 0x09, 0x42,
56 0x95, 0x02,
57 0x81, 0x02,
58 0x95, 0x05,
59 0x81, 0x03,
60 0x75, 0x10,
61 0x95, 0x01,
62 0x09, 0x30,
63 0x15, 0x05,
64 0x26, 0xFF, 0x07,
65 0x81, 0x02,
66 0x75, 0x10,
67 0x95, 0x01,
68 0x81, 0x03,
69 0xC0,
70 0xC0
71};
72
73static __u8 *viewsonic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
74 unsigned int *rsize)
75{
76 switch (hdev->product) {
77 case USB_DEVICE_ID_VIEWSONIC_PD1011:
78 case USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011:
79 if (*rsize == PD1011_RDESC_ORIG_SIZE) {
80 rdesc = pd1011_rdesc_fixed;
81 *rsize = sizeof(pd1011_rdesc_fixed);
82 }
83 break;
84 }
85
86 return rdesc;
87}
88
89static const struct hid_device_id viewsonic_devices[] = {
90 { HID_USB_DEVICE(USB_VENDOR_ID_VIEWSONIC,
91 USB_DEVICE_ID_VIEWSONIC_PD1011) },
92 { HID_USB_DEVICE(USB_VENDOR_ID_SIGNOTEC,
93 USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011) },
94 { }
95};
96MODULE_DEVICE_TABLE(hid, viewsonic_devices);
97
98static struct hid_driver viewsonic_driver = {
99 .name = "viewsonic",
100 .id_table = viewsonic_devices,
101 .report_fixup = viewsonic_report_fixup,
102};
103module_hid_driver(viewsonic_driver);
104
105MODULE_LICENSE("GPL");
106