aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r--drivers/hid/hid-input.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 0a68935c20b8..7f183b7147e1 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -700,7 +700,7 @@ static void hidinput_close(struct input_dev *dev)
700 * Read all reports and initialize the absolute field values. 700 * Read all reports and initialize the absolute field values.
701 */ 701 */
702 702
703int hidinput_connect(struct hid_device *hid) 703int hidinput_connect(struct hid_device *hid, unsigned int force)
704{ 704{
705 struct hid_report *report; 705 struct hid_report *report;
706 struct hid_input *hidinput = NULL; 706 struct hid_input *hidinput = NULL;
@@ -708,19 +708,20 @@ int hidinput_connect(struct hid_device *hid)
708 int i, j, k; 708 int i, j, k;
709 int max_report_type = HID_OUTPUT_REPORT; 709 int max_report_type = HID_OUTPUT_REPORT;
710 710
711 if (hid->quirks & HID_QUIRK_IGNORE_HIDINPUT)
712 return -1;
713
714 INIT_LIST_HEAD(&hid->inputs); 711 INIT_LIST_HEAD(&hid->inputs);
715 712
716 for (i = 0; i < hid->maxcollection; i++) 713 if (!force) {
717 if (hid->collection[i].type == HID_COLLECTION_APPLICATION || 714 for (i = 0; i < hid->maxcollection; i++) {
718 hid->collection[i].type == HID_COLLECTION_PHYSICAL) 715 struct hid_collection *col = &hid->collection[i];
719 if (IS_INPUT_APPLICATION(hid->collection[i].usage)) 716 if (col->type == HID_COLLECTION_APPLICATION ||
720 break; 717 col->type == HID_COLLECTION_PHYSICAL)
718 if (IS_INPUT_APPLICATION(col->usage))
719 break;
720 }
721 721
722 if (i == hid->maxcollection && (hid->quirks & HID_QUIRK_HIDINPUT) == 0) 722 if (i == hid->maxcollection)
723 return -1; 723 return -1;
724 }
724 725
725 if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS) 726 if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
726 max_report_type = HID_INPUT_REPORT; 727 max_report_type = HID_INPUT_REPORT;