18 #include <linux/device.h>
19 #include <linux/hid.h>
20 #include <linux/input.h>
21 #include <linux/module.h>
25 #define CP_RDESC_SWAPPED_MIN_MAX 0x01
26 #define CP_2WHEEL_MOUSE_HACK 0x02
27 #define CP_2WHEEL_MOUSE_HACK_ON 0x04
36 unsigned long quirks = (
unsigned long)hid_get_drvdata(hdev);
42 for (i = 0; i < *rsize - 4; i++)
43 if (rdesc[i] == 0x29 && rdesc[i + 2] == 0x19) {
49 rdesc[i + 3] = rdesc[i + 1];
57 unsigned long **
bit,
int *
max)
59 unsigned long quirks = (
unsigned long)hid_get_drvdata(hdev);
66 if (usage->
hid == 0x00090005)
75 unsigned long quirks = (
unsigned long)hid_get_drvdata(hdev);
81 if (usage->
hid == 0x00090005) {
86 hid_set_drvdata(hdev, (
void *)quirks);
102 unsigned long quirks =
id->driver_data;
105 hid_set_drvdata(hdev, (
void *)quirks);
107 ret = hid_parse(hdev);
109 hid_err(hdev,
"parse failed\n");
115 hid_err(hdev,
"hw start failed\n");
134 .driver_data = CP_2WHEEL_MOUSE_HACK },
141 .id_table = cp_devices,
142 .report_fixup = cp_report_fixup,
143 .input_mapped = cp_input_mapped,
148 static int __init cp_init(
void)