aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/hid-input.c
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@gmail.com>2006-11-04 22:49:53 -0500
committerDmitry Torokhov <dtor@insightbb.com>2006-11-04 22:49:53 -0500
commit41ad5fbabda0c3930136bb40cfc7a0c23013365f (patch)
treedb544c34e7cb6a4b785ab1c3b6aef69bc79363e3 /drivers/usb/input/hid-input.c
parent752c58a471c108d64da1676b2925dfbd83eb177e (diff)
Input: HID - add a quirk for the Logitech USB Receiver
Logitech USB Receiver (046d:c101) has two interfaces. The first one contains fields from HID_UP_KEYBOARD and HID_UP_LED, and the other one contains fields from HID_UP_CONSUMER and HID_UP_LOGIVENDOR. This device is used with multiple wireless Logitech products, including UltraX Media Remote. All fields on both interfaces are either keys or leds. All fields in the first interface are marked as Absolute, while the fields in the second interface are marked as Relative. Marking the keys as relative causes hidinput_hid_event() to send release events right after key press events. The device has EV_REP set, so the userspace expects the device to send repeat events if a key is held down. However, as hidinput_hid_event() sends release events immediately, repeat events are not sent at all. In fact, the userspace has no way of knowing if a key is being held down. Fix this by adding a quirk for 046d:c101 which changes relative keys to absolute ones. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb/input/hid-input.c')
-rw-r--r--drivers/usb/input/hid-input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
index 9a808a3b4d37..c8ce65c70a42 100644
--- a/drivers/usb/input/hid-input.c
+++ b/drivers/usb/input/hid-input.c
@@ -564,6 +564,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
564 || ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) 564 || ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007)))
565 goto ignore; 565 goto ignore;
566 566
567 if ((device->quirks & HID_QUIRK_BAD_RELATIVE_KEYS) &&
568 usage->type == EV_KEY && (field->flags & HID_MAIN_ITEM_RELATIVE))
569 field->flags &= ~HID_MAIN_ITEM_RELATIVE;
570
567 set_bit(usage->type, input->evbit); 571 set_bit(usage->type, input->evbit);
568 572
569 while (usage->code <= max && test_and_set_bit(usage->code, bit)) 573 while (usage->code <= max && test_and_set_bit(usage->code, bit))