diff options
Diffstat (limited to 'drivers/hid/hid-input-quirks.c')
-rw-r--r-- | drivers/hid/hid-input-quirks.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c index 1a4ba0313030..980e7456e260 100644 --- a/drivers/hid/hid-input-quirks.c +++ b/drivers/hid/hid-input-quirks.c | |||
@@ -16,43 +16,12 @@ | |||
16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
17 | #include <linux/hid.h> | 17 | #include <linux/hid.h> |
18 | 18 | ||
19 | #define map_key_clear(c) hid_map_usage_clear(hidinput, usage, bit, \ | ||
20 | max, EV_KEY, (c)) | ||
21 | |||
22 | static int quirk_gyration_remote(struct hid_usage *usage, | ||
23 | struct hid_input *hidinput, unsigned long **bit, int *max) | ||
24 | { | ||
25 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) | ||
26 | return 0; | ||
27 | |||
28 | set_bit(EV_REP, hidinput->input->evbit); | ||
29 | switch(usage->hid & HID_USAGE) { | ||
30 | /* Reported on Gyration MCE Remote */ | ||
31 | case 0x00d: map_key_clear(KEY_HOME); break; | ||
32 | case 0x024: map_key_clear(KEY_DVD); break; | ||
33 | case 0x025: map_key_clear(KEY_PVR); break; | ||
34 | case 0x046: map_key_clear(KEY_MEDIA); break; | ||
35 | case 0x047: map_key_clear(KEY_MP3); break; | ||
36 | case 0x049: map_key_clear(KEY_CAMERA); break; | ||
37 | case 0x04a: map_key_clear(KEY_VIDEO); break; | ||
38 | |||
39 | default: | ||
40 | return 0; | ||
41 | } | ||
42 | return 1; | ||
43 | } | ||
44 | |||
45 | #define VENDOR_ID_GYRATION 0x0c16 | ||
46 | #define DEVICE_ID_GYRATION_REMOTE 0x0002 | ||
47 | |||
48 | static const struct hid_input_blacklist { | 19 | static const struct hid_input_blacklist { |
49 | __u16 idVendor; | 20 | __u16 idVendor; |
50 | __u16 idProduct; | 21 | __u16 idProduct; |
51 | int (*quirk)(struct hid_usage *, struct hid_input *, unsigned long **, | 22 | int (*quirk)(struct hid_usage *, struct hid_input *, unsigned long **, |
52 | int *); | 23 | int *); |
53 | } hid_input_blacklist[] = { | 24 | } hid_input_blacklist[] = { |
54 | { VENDOR_ID_GYRATION, DEVICE_ID_GYRATION_REMOTE, quirk_gyration_remote }, | ||
55 | |||
56 | { 0, 0, NULL } | 25 | { 0, 0, NULL } |
57 | }; | 26 | }; |
58 | 27 | ||
@@ -74,21 +43,6 @@ int hidinput_mapping_quirks(struct hid_usage *usage, | |||
74 | 43 | ||
75 | int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) | 44 | int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) |
76 | { | 45 | { |
77 | struct input_dev *input; | ||
78 | |||
79 | input = field->hidinput->input; | ||
80 | |||
81 | /* Gyration MCE remote "Sleep" key */ | ||
82 | if (hid->vendor == VENDOR_ID_GYRATION && | ||
83 | hid->product == DEVICE_ID_GYRATION_REMOTE && | ||
84 | (usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK && | ||
85 | (usage->hid & 0xff) == 0x82) { | ||
86 | input_event(input, usage->type, usage->code, 1); | ||
87 | input_sync(input); | ||
88 | input_event(input, usage->type, usage->code, 0); | ||
89 | input_sync(input); | ||
90 | return 1; | ||
91 | } | ||
92 | return 0; | 46 | return 0; |
93 | } | 47 | } |
94 | 48 | ||