diff options
Diffstat (limited to 'drivers/hid/hid-input-quirks.c')
-rw-r--r-- | drivers/hid/hid-input-quirks.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c index a870ba58faa..dceadd0c141 100644 --- a/drivers/hid/hid-input-quirks.c +++ b/drivers/hid/hid-input-quirks.c | |||
@@ -352,7 +352,7 @@ int hidinput_mapping_quirks(struct hid_usage *usage, | |||
352 | return 0; | 352 | return 0; |
353 | } | 353 | } |
354 | 354 | ||
355 | void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) | 355 | int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) |
356 | { | 356 | { |
357 | struct input_dev *input; | 357 | struct input_dev *input; |
358 | 358 | ||
@@ -362,34 +362,34 @@ void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, stru | |||
362 | || ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) { | 362 | || ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) { |
363 | if (value) hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON; | 363 | if (value) hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON; |
364 | else hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON; | 364 | else hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON; |
365 | return; | 365 | return 1; |
366 | } | 366 | } |
367 | 367 | ||
368 | if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) && | 368 | if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) && |
369 | (usage->type == EV_REL) && | 369 | (usage->type == EV_REL) && |
370 | (usage->code == REL_WHEEL)) { | 370 | (usage->code == REL_WHEEL)) { |
371 | hid->delayed_value = value; | 371 | hid->delayed_value = value; |
372 | return; | 372 | return 1; |
373 | } | 373 | } |
374 | 374 | ||
375 | if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) && | 375 | if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) && |
376 | (usage->hid == 0x000100b8)) { | 376 | (usage->hid == 0x000100b8)) { |
377 | input_event(input, EV_REL, value ? REL_HWHEEL : REL_WHEEL, hid->delayed_value); | 377 | input_event(input, EV_REL, value ? REL_HWHEEL : REL_WHEEL, hid->delayed_value); |
378 | return; | 378 | return 1; |
379 | } | 379 | } |
380 | 380 | ||
381 | if ((hid->quirks & HID_QUIRK_INVERT_HWHEEL) && (usage->code == REL_HWHEEL)) { | 381 | if ((hid->quirks & HID_QUIRK_INVERT_HWHEEL) && (usage->code == REL_HWHEEL)) { |
382 | input_event(input, usage->type, usage->code, -value); | 382 | input_event(input, usage->type, usage->code, -value); |
383 | return; | 383 | return 1; |
384 | } | 384 | } |
385 | 385 | ||
386 | if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) && (usage->code == REL_WHEEL)) { | 386 | if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) && (usage->code == REL_WHEEL)) { |
387 | input_event(input, usage->type, REL_HWHEEL, value); | 387 | input_event(input, usage->type, REL_HWHEEL, value); |
388 | return; | 388 | return 1; |
389 | } | 389 | } |
390 | 390 | ||
391 | if ((hid->quirks & HID_QUIRK_APPLE_HAS_FN) && hidinput_apple_event(hid, input, usage, value)) | 391 | if ((hid->quirks & HID_QUIRK_APPLE_HAS_FN) && hidinput_apple_event(hid, input, usage, value)) |
392 | return; | 392 | return 1; |
393 | 393 | ||
394 | /* Handling MS keyboards special buttons */ | 394 | /* Handling MS keyboards special buttons */ |
395 | if (hid->quirks & HID_QUIRK_MICROSOFT_KEYS && | 395 | if (hid->quirks & HID_QUIRK_MICROSOFT_KEYS && |
@@ -416,8 +416,9 @@ void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, stru | |||
416 | if (hid->quirks & HID_QUIRK_HWHEEL_WHEEL_INVERT && | 416 | if (hid->quirks & HID_QUIRK_HWHEEL_WHEEL_INVERT && |
417 | usage->type == EV_REL && usage->code == REL_HWHEEL) { | 417 | usage->type == EV_REL && usage->code == REL_HWHEEL) { |
418 | input_event(input, usage->type, REL_WHEEL, -value); | 418 | input_event(input, usage->type, REL_WHEEL, -value); |
419 | return; | 419 | return 1; |
420 | } | 420 | } |
421 | return 0; | ||
421 | } | 422 | } |
422 | 423 | ||
423 | 424 | ||