-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrackpoint.patch
127 lines (124 loc) · 3.71 KB
/
trackpoint.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index 9dabd6323234..05f80e9de9d6 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -226,25 +226,6 @@ static int lenovo_input_mapping_cptkbd(struct hid_device *hdev,
(usage->hid & HID_USAGE) == 0x238)
return -1;
- /* Map wheel emulation reports: 0xffa1 = USB, 0xff10 = BT */
- if ((usage->hid & HID_USAGE_PAGE) == 0xff100000 ||
- (usage->hid & HID_USAGE_PAGE) == 0xffa10000) {
- field->flags |= HID_MAIN_ITEM_RELATIVE | HID_MAIN_ITEM_VARIABLE;
- field->logical_minimum = -127;
- field->logical_maximum = 127;
-
- switch (usage->hid & HID_USAGE) {
- case 0x0000:
- hid_map_usage(hi, usage, bit, max, EV_REL, REL_HWHEEL);
- return 1;
- case 0x0001:
- hid_map_usage(hi, usage, bit, max, EV_REL, REL_WHEEL);
- return 1;
- default:
- return -1;
- }
- }
-
return 0;
}
@@ -645,88 +626,6 @@ static int lenovo_raw_event(struct hid_device *hdev,
return 0;
}
-static int lenovo_event_tp10ubkbd(struct hid_device *hdev,
- struct hid_field *field, struct hid_usage *usage, __s32 value)
-{
- struct lenovo_drvdata *data = hid_get_drvdata(hdev);
-
- if (usage->type == EV_KEY && usage->code == KEY_FN_ESC && value == 1) {
- /*
- * The user has toggled the Fn-lock state. Toggle our own
- * cached value of it and sync our value to the keyboard to
- * ensure things are in sync (the sycning should be a no-op).
- */
- data->fn_lock = !data->fn_lock;
- schedule_work(&data->fn_lock_sync_work);
- }
-
- return 0;
-}
-
-static int lenovo_event_cptkbd(struct hid_device *hdev,
- struct hid_field *field, struct hid_usage *usage, __s32 value)
-{
- struct lenovo_drvdata *cptkbd_data = hid_get_drvdata(hdev);
-
- /* "wheel" scroll events */
- if (usage->type == EV_REL && (usage->code == REL_WHEEL ||
- usage->code == REL_HWHEEL)) {
- /* Scroll events disable middle-click event */
- cptkbd_data->middlebutton_state = 2;
- return 0;
- }
-
- /* Middle click events */
- if (usage->type == EV_KEY && usage->code == BTN_MIDDLE) {
- if (value == 1) {
- cptkbd_data->middlebutton_state = 1;
- } else if (value == 0) {
- if (cptkbd_data->middlebutton_state == 1) {
- /* No scrolling inbetween, send middle-click */
- input_event(field->hidinput->input,
- EV_KEY, BTN_MIDDLE, 1);
- input_sync(field->hidinput->input);
- input_event(field->hidinput->input,
- EV_KEY, BTN_MIDDLE, 0);
- input_sync(field->hidinput->input);
- }
- cptkbd_data->middlebutton_state = 0;
- }
- return 1;
- }
-
- if (usage->type == EV_KEY && usage->code == KEY_FN_ESC && value == 1) {
- /*
- * The user has toggled the Fn-lock state. Toggle our own
- * cached value of it and sync our value to the keyboard to
- * ensure things are in sync (the syncing should be a no-op).
- */
- cptkbd_data->fn_lock = !cptkbd_data->fn_lock;
- }
-
- return 0;
-}
-
-static int lenovo_event(struct hid_device *hdev, struct hid_field *field,
- struct hid_usage *usage, __s32 value)
-{
- if (!hid_get_drvdata(hdev))
- return 0;
-
- switch (hdev->product) {
- case USB_DEVICE_ID_LENOVO_CUSBKBD:
- case USB_DEVICE_ID_LENOVO_CBTKBD:
- case USB_DEVICE_ID_LENOVO_TPIIUSBKBD:
- case USB_DEVICE_ID_LENOVO_TPIIBTKBD:
- return lenovo_event_cptkbd(hdev, field, usage, value);
- case USB_DEVICE_ID_LENOVO_TP10UBKBD:
- case USB_DEVICE_ID_LENOVO_X1_TAB:
- return lenovo_event_tp10ubkbd(hdev, field, usage, value);
- default:
- return 0;
- }
-}
-
static int lenovo_features_set_tpkbd(struct hid_device *hdev)
{
struct hid_report *report;
@@ -1378,7 +1277,6 @@ static struct hid_driver lenovo_driver = {
.probe = lenovo_probe,
.remove = lenovo_remove,
.raw_event = lenovo_raw_event,
- .event = lenovo_event,
.report_fixup = lenovo_report_fixup,
};
module_hid_driver(lenovo_driver);