aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-11-26 07:26:33 -0500
committerJiri Kosina <jkosina@suse.cz>2008-01-28 08:51:21 -0500
commit628edcde87592a7ac6e72b555bb03ea265bcfbd2 (patch)
tree8ccffe1a294b0cb31f54cf0b5858b445a16dcd9c /drivers/hid
parent9a15c99714ca229dd0b894e200fd96daf14f32fb (diff)
HID: proper handling of MS 4k and 6k devices
This removes ugly macros IS_* to distinguish devices that need special handling in hid-input, and establish proper quirks for them. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-input-quirks.c6
-rw-r--r--drivers/hid/usbhid/hid-quirks.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c
index 7018be3a5a4c..fbe8b6de1a63 100644
--- a/drivers/hid/hid-input-quirks.c
+++ b/drivers/hid/hid-input-quirks.c
@@ -349,9 +349,6 @@ int hidinput_mapping_quirks(struct hid_usage *usage,
349 return 0; 349 return 0;
350} 350}
351 351
352#define IS_BTC8193(x) (x->vendor == 0x0518 && x->product == 0x0002)
353#define IS_MS_KB(x) (x->vendor == 0x045e && (x->product == 0x00db || x->product == 0x00f9))
354
355void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) 352void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
356{ 353{
357 struct input_dev *input; 354 struct input_dev *input;
@@ -392,7 +389,8 @@ void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, stru
392 return; 389 return;
393 390
394 /* Handling MS keyboards special buttons */ 391 /* Handling MS keyboards special buttons */
395 if (IS_MS_KB(hid) && usage->hid == (HID_UP_MSVENDOR | 0xff05)) { 392 if (hid->quirks & HID_QUIRK_MICROSOFT_KEYS &&
393 usage->hid == (HID_UP_MSVENDOR | 0xff05)) {
396 int key = 0; 394 int key = 0;
397 static int last_key = 0; 395 static int last_key = 0;
398 switch (value) { 396 switch (value) {
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index aa470f8c0103..dcb102d87414 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -305,6 +305,8 @@
305#define USB_VENDOR_ID_MICROSOFT 0x045e 305#define USB_VENDOR_ID_MICROSOFT 0x045e
306#define USB_DEVICE_ID_SIDEWINDER_GV 0x003b 306#define USB_DEVICE_ID_SIDEWINDER_GV 0x003b
307#define USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0 0x009d 307#define USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0 0x009d
308#define USB_DEVICE_ID_MS_NE4K 0x00db
309#define USB_DEVICE_ID_MS_LK6K 0x00f9
308 310
309#define USB_VENDOR_ID_MONTEREY 0x0566 311#define USB_VENDOR_ID_MONTEREY 0x0566
310#define USB_DEVICE_ID_GENIUS_KB29E 0x3004 312#define USB_DEVICE_ID_GENIUS_KB29E 0x3004
@@ -534,6 +536,9 @@ static const struct hid_blacklist {
534 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP }, 536 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP },
535 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP }, 537 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP },
536 538
539 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K, HID_QUIRK_MICROSOFT_KEYS },
540 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K, HID_QUIRK_MICROSOFT_KEYS },
541
537 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, 542 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
538 543
539 { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, 544 { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS },