diff options
Diffstat (limited to 'drivers/usb/input/hid-core.c')
-rw-r--r-- | drivers/usb/input/hid-core.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 2350e7a5ad70..b2cb2b35892e 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -789,12 +789,12 @@ static __inline__ int search(__s32 *array, __s32 value, unsigned n) | |||
789 | return -1; | 789 | return -1; |
790 | } | 790 | } |
791 | 791 | ||
792 | static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) | 792 | static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, int interrupt, struct pt_regs *regs) |
793 | { | 793 | { |
794 | hid_dump_input(usage, value); | 794 | hid_dump_input(usage, value); |
795 | if (hid->claimed & HID_CLAIMED_INPUT) | 795 | if (hid->claimed & HID_CLAIMED_INPUT) |
796 | hidinput_hid_event(hid, field, usage, value, regs); | 796 | hidinput_hid_event(hid, field, usage, value, regs); |
797 | if (hid->claimed & HID_CLAIMED_HIDDEV) | 797 | if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt) |
798 | hiddev_hid_event(hid, field, usage, value, regs); | 798 | hiddev_hid_event(hid, field, usage, value, regs); |
799 | } | 799 | } |
800 | 800 | ||
@@ -804,7 +804,7 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field, s | |||
804 | * reporting to the layer). | 804 | * reporting to the layer). |
805 | */ | 805 | */ |
806 | 806 | ||
807 | static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, struct pt_regs *regs) | 807 | static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt, struct pt_regs *regs) |
808 | { | 808 | { |
809 | unsigned n; | 809 | unsigned n; |
810 | unsigned count = field->report_count; | 810 | unsigned count = field->report_count; |
@@ -831,19 +831,19 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u | |||
831 | for (n = 0; n < count; n++) { | 831 | for (n = 0; n < count; n++) { |
832 | 832 | ||
833 | if (HID_MAIN_ITEM_VARIABLE & field->flags) { | 833 | if (HID_MAIN_ITEM_VARIABLE & field->flags) { |
834 | hid_process_event(hid, field, &field->usage[n], value[n], regs); | 834 | hid_process_event(hid, field, &field->usage[n], value[n], interrupt, regs); |
835 | continue; | 835 | continue; |
836 | } | 836 | } |
837 | 837 | ||
838 | if (field->value[n] >= min && field->value[n] <= max | 838 | if (field->value[n] >= min && field->value[n] <= max |
839 | && field->usage[field->value[n] - min].hid | 839 | && field->usage[field->value[n] - min].hid |
840 | && search(value, field->value[n], count)) | 840 | && search(value, field->value[n], count)) |
841 | hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, regs); | 841 | hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt, regs); |
842 | 842 | ||
843 | if (value[n] >= min && value[n] <= max | 843 | if (value[n] >= min && value[n] <= max |
844 | && field->usage[value[n] - min].hid | 844 | && field->usage[value[n] - min].hid |
845 | && search(field->value, value[n], count)) | 845 | && search(field->value, value[n], count)) |
846 | hid_process_event(hid, field, &field->usage[value[n] - min], 1, regs); | 846 | hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt, regs); |
847 | } | 847 | } |
848 | 848 | ||
849 | memcpy(field->value, value, count * sizeof(__s32)); | 849 | memcpy(field->value, value, count * sizeof(__s32)); |
@@ -851,7 +851,7 @@ exit: | |||
851 | kfree(value); | 851 | kfree(value); |
852 | } | 852 | } |
853 | 853 | ||
854 | static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs) | 854 | static int hid_input_report(int type, struct urb *urb, int interrupt, struct pt_regs *regs) |
855 | { | 855 | { |
856 | struct hid_device *hid = urb->context; | 856 | struct hid_device *hid = urb->context; |
857 | struct hid_report_enum *report_enum = hid->report_enum + type; | 857 | struct hid_report_enum *report_enum = hid->report_enum + type; |
@@ -899,7 +899,7 @@ static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs) | |||
899 | hiddev_report_event(hid, report); | 899 | hiddev_report_event(hid, report); |
900 | 900 | ||
901 | for (n = 0; n < report->maxfield; n++) | 901 | for (n = 0; n < report->maxfield; n++) |
902 | hid_input_field(hid, report->field[n], data, regs); | 902 | hid_input_field(hid, report->field[n], data, interrupt, regs); |
903 | 903 | ||
904 | if (hid->claimed & HID_CLAIMED_INPUT) | 904 | if (hid->claimed & HID_CLAIMED_INPUT) |
905 | hidinput_report_event(hid, report); | 905 | hidinput_report_event(hid, report); |
@@ -918,7 +918,7 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs) | |||
918 | 918 | ||
919 | switch (urb->status) { | 919 | switch (urb->status) { |
920 | case 0: /* success */ | 920 | case 0: /* success */ |
921 | hid_input_report(HID_INPUT_REPORT, urb, regs); | 921 | hid_input_report(HID_INPUT_REPORT, urb, 1, regs); |
922 | break; | 922 | break; |
923 | case -ECONNRESET: /* unlink */ | 923 | case -ECONNRESET: /* unlink */ |
924 | case -ENOENT: | 924 | case -ENOENT: |
@@ -1142,7 +1142,7 @@ static void hid_ctrl(struct urb *urb, struct pt_regs *regs) | |||
1142 | switch (urb->status) { | 1142 | switch (urb->status) { |
1143 | case 0: /* success */ | 1143 | case 0: /* success */ |
1144 | if (hid->ctrl[hid->ctrltail].dir == USB_DIR_IN) | 1144 | if (hid->ctrl[hid->ctrltail].dir == USB_DIR_IN) |
1145 | hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, regs); | 1145 | hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, 0, regs); |
1146 | case -ESHUTDOWN: /* unplug */ | 1146 | case -ESHUTDOWN: /* unplug */ |
1147 | case -EILSEQ: /* unplug timectrl on uhci */ | 1147 | case -EILSEQ: /* unplug timectrl on uhci */ |
1148 | unplug = 1; | 1148 | unplug = 1; |
@@ -1372,6 +1372,9 @@ void hid_init_reports(struct hid_device *hid) | |||
1372 | #define USB_VENDOR_ID_A4TECH 0x09da | 1372 | #define USB_VENDOR_ID_A4TECH 0x09da |
1373 | #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 | 1373 | #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 |
1374 | 1374 | ||
1375 | #define USB_VENDOR_ID_AASHIMA 0x06D6 | ||
1376 | #define USB_DEVICE_ID_AASHIMA_GAMEPAD 0x0025 | ||
1377 | |||
1375 | #define USB_VENDOR_ID_CYPRESS 0x04b4 | 1378 | #define USB_VENDOR_ID_CYPRESS 0x04b4 |
1376 | #define USB_DEVICE_ID_CYPRESS_MOUSE 0x0001 | 1379 | #define USB_DEVICE_ID_CYPRESS_MOUSE 0x0001 |
1377 | #define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500 | 1380 | #define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500 |
@@ -1548,6 +1551,7 @@ static struct hid_blacklist { | |||
1548 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, | 1551 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, |
1549 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, | 1552 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, |
1550 | 1553 | ||
1554 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD, HID_QUIRK_BADPAD }, | ||
1551 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, | 1555 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, |
1552 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, | 1556 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, |
1553 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 1557 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |