HID: use hid_hw_request() instead of direct call to usbhid
[linux-2.6-block.git] / drivers / hid / hid-lg4ff.c
index d7947c701f3063ac6c3683c29d3eca333b7ca1b0..7da40a1797cd83b6675ab1fe8998ebba7d30202e 100644 (file)
 #define G27_REV_MAJ 0x12
 #define G27_REV_MIN 0x38
 
-#define DFP_X_MIN 0
-#define DFP_X_MAX 16383
-#define DFP_PEDAL_MIN 0
-#define DFP_PEDAL_MAX 255
-
 #define to_hid_device(pdev) container_of(pdev, struct hid_device, dev)
 
 static void hid_lg4ff_set_range_dfp(struct hid_device *hid, u16 range);
@@ -207,7 +202,7 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e
                value[5] = 0x00;
                value[6] = 0x00;
 
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
                break;
        }
        return 0;
@@ -230,7 +225,7 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud
        value[5] = 0x00;
        value[6] = 0x00;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 /* Sends autocentering command compatible with Formula Force EX */
@@ -250,7 +245,7 @@ static void hid_lg4ff_set_autocenter_ffex(struct input_dev *dev, u16 magnitude)
        value[5] = 0x00;
        value[6] = 0x00;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 /* Sends command to set range compatible with G25/G27/Driving Force GT */
@@ -270,7 +265,7 @@ static void hid_lg4ff_set_range_g25(struct hid_device *hid, u16 range)
        value[5] = 0x00;
        value[6] = 0x00;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 /* Sends commands to set range compatible with Driving Force Pro wheel */
@@ -299,7 +294,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
                report->field[0]->value[1] = 0x02;
                full_range = 200;
        }
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 
        /* Prepare "fine" limit command */
        value[0] = 0x81;
@@ -311,7 +306,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
        value[6] = 0x00;
 
        if (range == 200 || range == 900) {     /* Do not apply any fine limit */
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
                return;
        }
 
@@ -325,7 +320,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
        value[5] = (start_right & 0xe) << 4 | (start_left & 0xe);
        value[6] = 0xff;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 static void hid_lg4ff_switch_native(struct hid_device *hid, const struct lg4ff_native_cmd *cmd)
@@ -339,7 +334,7 @@ static void hid_lg4ff_switch_native(struct hid_device *hid, const struct lg4ff_n
                for (i = 0; i < 7; i++)
                        report->field[0]->value[i] = cmd->cmd[j++];
 
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
        }
 }
 
@@ -415,7 +410,7 @@ static void lg4ff_set_leds(struct hid_device *hid, __u8 leds)
        value[4] = 0x00;
        value[5] = 0x00;
        value[6] = 0x00;
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
@@ -598,18 +593,6 @@ int lg4ff_init(struct hid_device *hid)
                return error;
        dbg_hid("sysfs interface created\n");
 
-       /* Set default axes parameters */
-       switch (lg4ff_devices[i].product_id) {
-       case USB_DEVICE_ID_LOGITECH_DFP_WHEEL:
-               dbg_hid("Setting axes parameters for Driving Force Pro\n");
-               input_set_abs_params(dev, ABS_X, DFP_X_MIN, DFP_X_MAX, 0, 0);
-               input_set_abs_params(dev, ABS_Y, DFP_PEDAL_MIN, DFP_PEDAL_MAX, 0, 0);
-               input_set_abs_params(dev, ABS_RZ, DFP_PEDAL_MIN, DFP_PEDAL_MAX, 0, 0);
-               break;
-       default:
-               break;
-       }
-
        /* Set the maximum range to start with */
        entry->range = entry->max_range;
        if (entry->set_range != NULL)