diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 368fbb0c4ca6b161d2acea66d7a10bdf4c6a36f5..2e2aa759d230ebf80802120bdbe59f5357f1d8fa 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1357,6 +1357,7 @@ static const struct hid_device_id hid_blacklist[] = { { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324) }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) }, diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index cd4ece6fdfb967b8fe89227742dd49e13b09df67..0c4e75573186ba08e78f7b301c20bcb749ffd80e 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -564,10 +564,10 @@ void hid_debug_event(struct hid_device *hdev, char *buf) struct hid_debug_list *list; list_for_each_entry(list, &hdev->debug_list, node) { - for (i = 0; i <= strlen(buf); i++) - list->hid_debug_buf[(list->tail + i) % (HID_DEBUG_BUFSIZE - 1)] = + for (i = 0; i < strlen(buf); i++) + list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] = buf[i]; - list->tail = (list->tail + i) % (HID_DEBUG_BUFSIZE - 1); + list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE; } } EXPORT_SYMBOL_GPL(hid_debug_event); diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 72c05f90553c7ec84351a34acf2ff6fc3ca10dbc..797e064703563fcc9dc8cedf6aea1c5af3a26290 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -445,6 +445,7 @@ #define USB_VENDOR_ID_UCLOGIC 0x5543 #define USB_DEVICE_ID_UCLOGIC_TABLET_PF1209 0x0042 +#define USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U 0x0003 #define USB_VENDOR_ID_VERNIER 0x08f7 #define USB_DEVICE_ID_VERNIER_LABPRO 0x0001 diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 4a3a94f2b10c93ca809b03c2d68c7a245dd7bfa1..c174b64c381067fbf7644cd848d8a30e543558c9 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -353,7 +353,7 @@ static int magicmouse_probe(struct hid_device *hdev, goto err_free; } - ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); + ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDINPUT); if (ret) { dev_err(&hdev->dev, "magicmouse hw start failed\n"); goto err_free; @@ -409,8 +409,11 @@ static int magicmouse_probe(struct hid_device *hdev, static void magicmouse_remove(struct hid_device *hdev) { + struct magicmouse_sc *msc = hid_get_drvdata(hdev); + hid_hw_stop(hdev); - kfree(hid_get_drvdata(hdev)); + input_unregister_device(msc->input); + kfree(msc); } static const struct hid_device_id magic_mice[] = { diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 3234c729a895f1cf733e59149c07eb5e83fac1b6..edcc0c4247bb6c62f99b2bcbd22d77c90ab05577 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -140,6 +140,9 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, nd->reading_mt = 1; nd->first_contact_confidence = 0; break; + case HID_DG_TIPSWITCH: + /* Prevent emission of touch until validated */ + return 1; case HID_DG_CONFIDENCE: nd->confidence = value; break; @@ -259,6 +262,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, BTN_TOOL_TRIPLETAP, 0); input_report_key(input, BTN_TOOL_QUADTAP, 0); + input_report_key(input, BTN_TOUCH, 0); } break; @@ -308,13 +312,20 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) list_for_each_entry(hidinput, &hdev->inputs, list) { + if (hidinput->report->maxfield < 1) + continue; + input = hidinput->input; switch (hidinput->report->field[0]->application) { case HID_DG_PEN: input->name = "N-Trig Pen"; break; case HID_DG_TOUCHSCREEN: + /* These keys are redundant for fingers, clear them + * to prevent incorrect identification */ __clear_bit(BTN_TOOL_PEN, input->keybit); + __clear_bit(BTN_TOOL_FINGER, input->keybit); + __clear_bit(BTN_0, input->keybit); /* * A little something special to enable * two and three finger taps. diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index 167ea746fb9c3e5d5faa7f5cbae033baa77bfad8..c32f32c84ac8706d2220b4be1516fe1ac60eea69 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c @@ -251,6 +251,8 @@ static const struct hid_device_id tm_devices[] = { .driver_data = (unsigned long)ff_rumble }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651), /* FGT Rumble Force Wheel */ .driver_data = (unsigned long)ff_rumble }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653), /* RGT Force Feedback CLUTCH Raging Wheel */ + .driver_data = (unsigned long)ff_joystick }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654), /* FGT Force Feedback Wheel */ .driver_data = (unsigned long)ff_joystick }, { } diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 7844280897d1940c1a02ac37b95305ad7ad49d39..928943c7ce9a676aaaaa62e2fdb5652aef4ed16c 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -63,6 +63,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },