diff options
Diffstat (limited to 'drivers/usb/input/hid-input.c')
-rw-r--r-- | drivers/usb/input/hid-input.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index 5553c3553e9d..9ac1e9095334 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c | |||
@@ -164,7 +164,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
164 | case HID_GD_X: case HID_GD_Y: case HID_GD_Z: | 164 | case HID_GD_X: case HID_GD_Y: case HID_GD_Z: |
165 | case HID_GD_RX: case HID_GD_RY: case HID_GD_RZ: | 165 | case HID_GD_RX: case HID_GD_RY: case HID_GD_RZ: |
166 | case HID_GD_SLIDER: case HID_GD_DIAL: case HID_GD_WHEEL: | 166 | case HID_GD_SLIDER: case HID_GD_DIAL: case HID_GD_WHEEL: |
167 | if (field->flags & HID_MAIN_ITEM_RELATIVE) | 167 | if (field->flags & HID_MAIN_ITEM_RELATIVE) |
168 | map_rel(usage->hid & 0xf); | 168 | map_rel(usage->hid & 0xf); |
169 | else | 169 | else |
170 | map_abs(usage->hid & 0xf); | 170 | map_abs(usage->hid & 0xf); |
@@ -297,7 +297,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
297 | case HID_UP_MSVENDOR: | 297 | case HID_UP_MSVENDOR: |
298 | 298 | ||
299 | goto ignore; | 299 | goto ignore; |
300 | 300 | ||
301 | case HID_UP_PID: | 301 | case HID_UP_PID: |
302 | 302 | ||
303 | set_bit(EV_FF, input->evbit); | 303 | set_bit(EV_FF, input->evbit); |
@@ -349,7 +349,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
349 | goto ignore; | 349 | goto ignore; |
350 | 350 | ||
351 | if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5)) && | 351 | if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5)) && |
352 | (usage->type == EV_REL) && (usage->code == REL_WHEEL)) | 352 | (usage->type == EV_REL) && (usage->code == REL_WHEEL)) |
353 | set_bit(REL_HWHEEL, bit); | 353 | set_bit(REL_HWHEEL, bit); |
354 | 354 | ||
355 | if (((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005)) | 355 | if (((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005)) |
@@ -365,11 +365,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
365 | a = field->logical_minimum = 0; | 365 | a = field->logical_minimum = 0; |
366 | b = field->logical_maximum = 255; | 366 | b = field->logical_maximum = 255; |
367 | } | 367 | } |
368 | 368 | ||
369 | if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK) | 369 | if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK) |
370 | input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4); | 370 | input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4); |
371 | else input_set_abs_params(input, usage->code, a, b, 0, 0); | 371 | else input_set_abs_params(input, usage->code, a, b, 0, 0); |
372 | 372 | ||
373 | } | 373 | } |
374 | 374 | ||
375 | if (usage->hat_min < usage->hat_max || usage->hat_dir) { | 375 | if (usage->hat_min < usage->hat_max || usage->hat_dir) { |
@@ -420,7 +420,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct | |||
420 | return; | 420 | return; |
421 | } | 421 | } |
422 | 422 | ||
423 | if (usage->hat_min < usage->hat_max || usage->hat_dir) { | 423 | if (usage->hat_min < usage->hat_max || usage->hat_dir) { |
424 | int hat_dir = usage->hat_dir; | 424 | int hat_dir = usage->hat_dir; |
425 | if (!hat_dir) | 425 | if (!hat_dir) |
426 | hat_dir = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1; | 426 | hat_dir = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1; |
@@ -551,7 +551,7 @@ int hidinput_connect(struct hid_device *hid) | |||
551 | for (i = 0; i < hid->maxcollection; i++) | 551 | for (i = 0; i < hid->maxcollection; i++) |
552 | if (hid->collection[i].type == HID_COLLECTION_APPLICATION || | 552 | if (hid->collection[i].type == HID_COLLECTION_APPLICATION || |
553 | hid->collection[i].type == HID_COLLECTION_PHYSICAL) | 553 | hid->collection[i].type == HID_COLLECTION_PHYSICAL) |
554 | if (IS_INPUT_APPLICATION(hid->collection[i].usage)) | 554 | if (IS_INPUT_APPLICATION(hid->collection[i].usage)) |
555 | break; | 555 | break; |
556 | 556 | ||
557 | if (i == hid->maxcollection) | 557 | if (i == hid->maxcollection) |
@@ -592,7 +592,7 @@ int hidinput_connect(struct hid_device *hid) | |||
592 | for (j = 0; j < report->field[i]->maxusage; j++) | 592 | for (j = 0; j < report->field[i]->maxusage; j++) |
593 | hidinput_configure_usage(hidinput, report->field[i], | 593 | hidinput_configure_usage(hidinput, report->field[i], |
594 | report->field[i]->usage + j); | 594 | report->field[i]->usage + j); |
595 | 595 | ||
596 | if (hid->quirks & HID_QUIRK_MULTI_INPUT) { | 596 | if (hid->quirks & HID_QUIRK_MULTI_INPUT) { |
597 | /* This will leave hidinput NULL, so that it | 597 | /* This will leave hidinput NULL, so that it |
598 | * allocates another one if we have more inputs on | 598 | * allocates another one if we have more inputs on |