[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTim3WY4yUWMQUBMV0q--w2U6LeVb_CYVgkUL_5tT@mail.gmail.com>
Date: Fri, 7 Jan 2011 12:12:19 +0100
From: Benjamin Tissoires <benjamin.tissoires@...c.fr>
To: Henrik Rydberg <rydberg@...omail.se>
Cc: Stephane Chatty <chatty@...c.fr>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Jiri Kosina <jkosina@...e.cz>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC v2 01/10] hid: add feature_mapping callback
On Fri, Jan 7, 2011 at 11:18 AM, Henrik Rydberg <rydberg@...omail.se> wrote:
>> >> struct input_dev *input_dev;
>> >> int i, j, k;
>> >> - int max_report_type = HID_OUTPUT_REPORT;
>> >> + int max_report_type = HID_FEATURE_REPORT;
>> >
>> > Doing it this way conflicts with the HID_QUIRK_SKIP_OUTPUT_REPORTS quirk.
>>
>>
>> Do you agree on this way? (will send the patch in the next version)
>>
>> @@ -834,11 +842,10 @@ int hidinput_connect(struct hid_device *hid,
>> unsigned int force)
>> {
>> struct hid_report *report;
>> struct hid_input *hidinput = NULL;
>> struct input_dev *input_dev;
>> int i, j, k;
>> - int max_report_type = HID_OUTPUT_REPORT;
>>
>> INIT_LIST_HEAD(&hid->inputs);
>>
>> if (!force) {
>> for (i = 0; i < hid->maxcollection; i++) {
>> @@ -851,14 +858,14 @@ int hidinput_connect(struct hid_device *hid,
>> unsigned int force)
>>
>> if (i == hid->maxcollection)
>> return -1;
>> }
>>
>> - if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
>> - max_report_type = HID_INPUT_REPORT;
>> + for (k = HID_INPUT_REPORT; k <= HID_FEATURE_REPORT; k++)
>> + if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
>> + continue;
>>
>> - for (k = HID_INPUT_REPORT; k <= max_report_type; k++)
>> list_for_each_entry(report, &hid->report_enum[k].report_list, list) {
>>
>> if (!report->maxfield)
>> continue;
>
> Perfect.
Well, in fact, I made 2 big mistakes (forgot the brackets after
for(;;), and test if k==HID_OUTPUT_REPORT...), but the idea is still
the same.
Sorry,
Benjamin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists