aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-lg4ff.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-lg4ff.c')
-rw-r--r--drivers/hid/hid-lg4ff.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index 65a6ec8d3742..0ddae2a00d59 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -34,6 +34,7 @@
34 34
35#define DFGT_REV_MAJ 0x13 35#define DFGT_REV_MAJ 0x13
36#define DFGT_REV_MIN 0x22 36#define DFGT_REV_MIN 0x22
37#define DFGT2_REV_MIN 0x26
37#define DFP_REV_MAJ 0x11 38#define DFP_REV_MAJ 0x11
38#define DFP_REV_MIN 0x06 39#define DFP_REV_MIN 0x06
39#define FFEX_REV_MAJ 0x21 40#define FFEX_REV_MAJ 0x21
@@ -125,6 +126,7 @@ static const struct lg4ff_native_cmd native_g27 = {
125 126
126static const struct lg4ff_usb_revision lg4ff_revs[] = { 127static const struct lg4ff_usb_revision lg4ff_revs[] = {
127 {DFGT_REV_MAJ, DFGT_REV_MIN, &native_dfgt}, /* Driving Force GT */ 128 {DFGT_REV_MAJ, DFGT_REV_MIN, &native_dfgt}, /* Driving Force GT */
129 {DFGT_REV_MAJ, DFGT2_REV_MIN, &native_dfgt}, /* Driving Force GT v2 */
128 {DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */ 130 {DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */
129 {G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */ 131 {G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */
130 {G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */ 132 {G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */
@@ -202,7 +204,7 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e
202 value[5] = 0x00; 204 value[5] = 0x00;
203 value[6] = 0x00; 205 value[6] = 0x00;
204 206
205 usbhid_submit_report(hid, report, USB_DIR_OUT); 207 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
206 break; 208 break;
207 } 209 }
208 return 0; 210 return 0;
@@ -225,7 +227,7 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud
225 value[5] = 0x00; 227 value[5] = 0x00;
226 value[6] = 0x00; 228 value[6] = 0x00;
227 229
228 usbhid_submit_report(hid, report, USB_DIR_OUT); 230 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
229} 231}
230 232
231/* Sends autocentering command compatible with Formula Force EX */ 233/* Sends autocentering command compatible with Formula Force EX */
@@ -245,7 +247,7 @@ static void hid_lg4ff_set_autocenter_ffex(struct input_dev *dev, u16 magnitude)
245 value[5] = 0x00; 247 value[5] = 0x00;
246 value[6] = 0x00; 248 value[6] = 0x00;
247 249
248 usbhid_submit_report(hid, report, USB_DIR_OUT); 250 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
249} 251}
250 252
251/* Sends command to set range compatible with G25/G27/Driving Force GT */ 253/* Sends command to set range compatible with G25/G27/Driving Force GT */
@@ -265,7 +267,7 @@ static void hid_lg4ff_set_range_g25(struct hid_device *hid, u16 range)
265 value[5] = 0x00; 267 value[5] = 0x00;
266 value[6] = 0x00; 268 value[6] = 0x00;
267 269
268 usbhid_submit_report(hid, report, USB_DIR_OUT); 270 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
269} 271}
270 272
271/* Sends commands to set range compatible with Driving Force Pro wheel */ 273/* Sends commands to set range compatible with Driving Force Pro wheel */
@@ -294,7 +296,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
294 report->field[0]->value[1] = 0x02; 296 report->field[0]->value[1] = 0x02;
295 full_range = 200; 297 full_range = 200;
296 } 298 }
297 usbhid_submit_report(hid, report, USB_DIR_OUT); 299 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
298 300
299 /* Prepare "fine" limit command */ 301 /* Prepare "fine" limit command */
300 value[0] = 0x81; 302 value[0] = 0x81;
@@ -306,7 +308,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
306 value[6] = 0x00; 308 value[6] = 0x00;
307 309
308 if (range == 200 || range == 900) { /* Do not apply any fine limit */ 310 if (range == 200 || range == 900) { /* Do not apply any fine limit */
309 usbhid_submit_report(hid, report, USB_DIR_OUT); 311 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
310 return; 312 return;
311 } 313 }
312 314
@@ -320,7 +322,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
320 value[5] = (start_right & 0xe) << 4 | (start_left & 0xe); 322 value[5] = (start_right & 0xe) << 4 | (start_left & 0xe);
321 value[6] = 0xff; 323 value[6] = 0xff;
322 324
323 usbhid_submit_report(hid, report, USB_DIR_OUT); 325 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
324} 326}
325 327
326static void hid_lg4ff_switch_native(struct hid_device *hid, const struct lg4ff_native_cmd *cmd) 328static void hid_lg4ff_switch_native(struct hid_device *hid, const struct lg4ff_native_cmd *cmd)
@@ -334,7 +336,7 @@ static void hid_lg4ff_switch_native(struct hid_device *hid, const struct lg4ff_n
334 for (i = 0; i < 7; i++) 336 for (i = 0; i < 7; i++)
335 report->field[0]->value[i] = cmd->cmd[j++]; 337 report->field[0]->value[i] = cmd->cmd[j++];
336 338
337 usbhid_submit_report(hid, report, USB_DIR_OUT); 339 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
338 } 340 }
339} 341}
340 342
@@ -410,7 +412,7 @@ static void lg4ff_set_leds(struct hid_device *hid, __u8 leds)
410 value[4] = 0x00; 412 value[4] = 0x00;
411 value[5] = 0x00; 413 value[5] = 0x00;
412 value[6] = 0x00; 414 value[6] = 0x00;
413 usbhid_submit_report(hid, report, USB_DIR_OUT); 415 hid_hw_request(hid, report, HID_REQ_SET_REPORT);
414} 416}
415 417
416static void lg4ff_led_set_brightness(struct led_classdev *led_cdev, 418static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,