diff options
| author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-02-10 12:58:54 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-17 08:56:50 -0500 |
| commit | b0dd72aafd785785bedbb6db932955807e454a65 (patch) | |
| tree | 9957e630bb70bd5c8f177546a8b805f281c17ac8 | |
| parent | bd27e202c640d19fbf948a56914c230dcbaee6d0 (diff) | |
HID: replace hid_output_raw_report with hid_hw_raw_request for feature requests
ret = hid_output_raw_report(A, B, C, HID_FEATURE_REPORT);
is equivalent to
ret = hid_hw_raw_request(A, B[0], B, C, HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
whatever the transport layer is.
So use the new API where available
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| -rw-r--r-- | drivers/hid/hid-lg.c | 8 | ||||
| -rw-r--r-- | drivers/hid/hid-magicmouse.c | 4 | ||||
| -rw-r--r-- | drivers/hid/hid-sony.c | 4 | ||||
| -rw-r--r-- | drivers/hid/hid-thingm.c | 4 | ||||
| -rw-r--r-- | drivers/hid/hid-wacom.c | 26 |
5 files changed, 25 insertions, 21 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 76ed7e512dcf..a976f48263f6 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
| @@ -692,8 +692,8 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
| 692 | if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { | 692 | if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { |
| 693 | unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | 693 | unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 694 | 694 | ||
| 695 | ret = hid_output_raw_report(hdev, buf, sizeof(buf), | 695 | ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), |
| 696 | HID_FEATURE_REPORT); | 696 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 697 | 697 | ||
| 698 | if (ret >= 0) { | 698 | if (ret >= 0) { |
| 699 | /* insert a little delay of 10 jiffies ~ 40ms */ | 699 | /* insert a little delay of 10 jiffies ~ 40ms */ |
| @@ -705,8 +705,8 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
| 705 | buf[1] = 0xB2; | 705 | buf[1] = 0xB2; |
| 706 | get_random_bytes(&buf[2], 2); | 706 | get_random_bytes(&buf[2], 2); |
| 707 | 707 | ||
| 708 | ret = hid_output_raw_report(hdev, buf, sizeof(buf), | 708 | ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), |
| 709 | HID_FEATURE_REPORT); | 709 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 710 | } | 710 | } |
| 711 | } | 711 | } |
| 712 | 712 | ||
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index cb5db3afc690..ecc2cbf300cc 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c | |||
| @@ -538,8 +538,8 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
| 538 | * but there seems to be no other way of switching the mode. | 538 | * but there seems to be no other way of switching the mode. |
| 539 | * Thus the super-ugly hacky success check below. | 539 | * Thus the super-ugly hacky success check below. |
| 540 | */ | 540 | */ |
| 541 | ret = hid_output_raw_report(hdev, feature, sizeof(feature), | 541 | ret = hid_hw_raw_request(hdev, feature[0], feature, sizeof(feature), |
| 542 | HID_FEATURE_REPORT); | 542 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 543 | if (ret != -EIO && ret != sizeof(feature)) { | 543 | if (ret != -EIO && ret != sizeof(feature)) { |
| 544 | hid_err(hdev, "unable to request touch data (%d)\n", ret); | 544 | hid_err(hdev, "unable to request touch data (%d)\n", ret); |
| 545 | goto err_stop_hw; | 545 | goto err_stop_hw; |
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 075089b37236..e3e89b6a41c2 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
| @@ -720,8 +720,8 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) | |||
| 720 | static int sixaxis_set_operational_bt(struct hid_device *hdev) | 720 | static int sixaxis_set_operational_bt(struct hid_device *hdev) |
| 721 | { | 721 | { |
| 722 | unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 }; | 722 | unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 }; |
| 723 | return hid_output_raw_report(hdev, buf, sizeof(buf), | 723 | return hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), |
| 724 | HID_FEATURE_REPORT); | 724 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 725 | } | 725 | } |
| 726 | 726 | ||
| 727 | static void buzz_set_leds(struct hid_device *hdev, const __u8 *leds) | 727 | static void buzz_set_leds(struct hid_device *hdev, const __u8 *leds) |
diff --git a/drivers/hid/hid-thingm.c b/drivers/hid/hid-thingm.c index 7dd3197f3b3e..a97c78845f7b 100644 --- a/drivers/hid/hid-thingm.c +++ b/drivers/hid/hid-thingm.c | |||
| @@ -48,8 +48,8 @@ static int blink1_send_command(struct blink1_data *data, | |||
| 48 | buf[0], buf[1], buf[2], buf[3], buf[4], | 48 | buf[0], buf[1], buf[2], buf[3], buf[4], |
| 49 | buf[5], buf[6], buf[7], buf[8]); | 49 | buf[5], buf[6], buf[7], buf[8]); |
| 50 | 50 | ||
| 51 | ret = hid_output_raw_report(data->hdev, buf, BLINK1_CMD_SIZE, | 51 | ret = hid_hw_raw_request(data->hdev, buf[0], buf, BLINK1_CMD_SIZE, |
| 52 | HID_FEATURE_REPORT); | 52 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 53 | 53 | ||
| 54 | return ret < 0 ? ret : 0; | 54 | return ret < 0 ? ret : 0; |
| 55 | } | 55 | } |
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index c720db912edb..902013ec041b 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c | |||
| @@ -128,7 +128,8 @@ static void wacom_set_image(struct hid_device *hdev, const char *image, | |||
| 128 | 128 | ||
| 129 | rep_data[0] = WAC_CMD_ICON_START_STOP; | 129 | rep_data[0] = WAC_CMD_ICON_START_STOP; |
| 130 | rep_data[1] = 0; | 130 | rep_data[1] = 0; |
| 131 | ret = hid_output_raw_report(hdev, rep_data, 2, HID_FEATURE_REPORT); | 131 | ret = hid_hw_raw_request(hdev, rep_data[0], rep_data, 2, |
| 132 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | ||
| 132 | if (ret < 0) | 133 | if (ret < 0) |
| 133 | goto err; | 134 | goto err; |
| 134 | 135 | ||
| @@ -142,14 +143,15 @@ static void wacom_set_image(struct hid_device *hdev, const char *image, | |||
| 142 | rep_data[j + 3] = p[(i << 6) + j]; | 143 | rep_data[j + 3] = p[(i << 6) + j]; |
| 143 | 144 | ||
| 144 | rep_data[2] = i; | 145 | rep_data[2] = i; |
| 145 | ret = hid_output_raw_report(hdev, rep_data, 67, | 146 | ret = hid_hw_raw_request(hdev, rep_data[0], rep_data, 67, |
| 146 | HID_FEATURE_REPORT); | 147 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 147 | } | 148 | } |
| 148 | 149 | ||
| 149 | rep_data[0] = WAC_CMD_ICON_START_STOP; | 150 | rep_data[0] = WAC_CMD_ICON_START_STOP; |
| 150 | rep_data[1] = 0; | 151 | rep_data[1] = 0; |
| 151 | 152 | ||
| 152 | ret = hid_output_raw_report(hdev, rep_data, 2, HID_FEATURE_REPORT); | 153 | ret = hid_hw_raw_request(hdev, rep_data[0], rep_data, 2, |
| 154 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | ||
| 153 | 155 | ||
| 154 | err: | 156 | err: |
| 155 | return; | 157 | return; |
| @@ -181,7 +183,8 @@ static void wacom_leds_set_brightness(struct led_classdev *led_dev, | |||
| 181 | buf[3] = value; | 183 | buf[3] = value; |
| 182 | /* use fixed brightness for OLEDs */ | 184 | /* use fixed brightness for OLEDs */ |
| 183 | buf[4] = 0x08; | 185 | buf[4] = 0x08; |
| 184 | hid_output_raw_report(hdev, buf, 9, HID_FEATURE_REPORT); | 186 | hid_hw_raw_request(hdev, buf[0], buf, 9, HID_FEATURE_REPORT, |
| 187 | HID_REQ_SET_REPORT); | ||
| 185 | kfree(buf); | 188 | kfree(buf); |
| 186 | } | 189 | } |
| 187 | 190 | ||
| @@ -337,8 +340,8 @@ static void wacom_set_features(struct hid_device *hdev, u8 speed) | |||
| 337 | rep_data[0] = 0x03 ; rep_data[1] = 0x00; | 340 | rep_data[0] = 0x03 ; rep_data[1] = 0x00; |
| 338 | limit = 3; | 341 | limit = 3; |
| 339 | do { | 342 | do { |
| 340 | ret = hid_output_raw_report(hdev, rep_data, 2, | 343 | ret = hid_hw_raw_request(hdev, rep_data[0], rep_data, 2, |
| 341 | HID_FEATURE_REPORT); | 344 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 342 | } while (ret < 0 && limit-- > 0); | 345 | } while (ret < 0 && limit-- > 0); |
| 343 | 346 | ||
| 344 | if (ret >= 0) { | 347 | if (ret >= 0) { |
| @@ -350,8 +353,9 @@ static void wacom_set_features(struct hid_device *hdev, u8 speed) | |||
| 350 | rep_data[1] = 0x00; | 353 | rep_data[1] = 0x00; |
| 351 | limit = 3; | 354 | limit = 3; |
| 352 | do { | 355 | do { |
| 353 | ret = hid_output_raw_report(hdev, | 356 | ret = hid_hw_raw_request(hdev, rep_data[0], |
| 354 | rep_data, 2, HID_FEATURE_REPORT); | 357 | rep_data, 2, HID_FEATURE_REPORT, |
| 358 | HID_REQ_SET_REPORT); | ||
| 355 | } while (ret < 0 && limit-- > 0); | 359 | } while (ret < 0 && limit-- > 0); |
| 356 | 360 | ||
| 357 | if (ret >= 0) { | 361 | if (ret >= 0) { |
| @@ -376,8 +380,8 @@ static void wacom_set_features(struct hid_device *hdev, u8 speed) | |||
| 376 | rep_data[0] = 0x03; | 380 | rep_data[0] = 0x03; |
| 377 | rep_data[1] = wdata->features; | 381 | rep_data[1] = wdata->features; |
| 378 | 382 | ||
| 379 | ret = hid_output_raw_report(hdev, rep_data, 2, | 383 | ret = hid_hw_raw_request(hdev, rep_data[0], rep_data, 2, |
| 380 | HID_FEATURE_REPORT); | 384 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
| 381 | if (ret >= 0) | 385 | if (ret >= 0) |
| 382 | wdata->high_speed = speed; | 386 | wdata->high_speed = speed; |
| 383 | break; | 387 | break; |
