From d881427253da011495f4193663d809d0e9dfa215 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Mon, 25 Feb 2013 11:31:46 +0100 Subject: HID: use hid_hw_request() instead of direct call to usbhid This allows the hid drivers to be independent from the transport layer. The patch was constructed by replacing all occurences of usbhid_submit_report() by its hid_hw_request() counterpart. Then, drivers not requiring USB_HID anymore have their USB_HID dependency cleaned in the Kconfig file. Finally, few drivers still depends on USB_HID. Many of them are requiring the io wait callback. They are found in the next patch. Signed-off-by: Benjamin Tissoires Reviewed-by: Mika Westerberg For the sensor-hub part: Tested-by: Mika Westerberg Signed-off-by: Jiri Kosina --- drivers/hid/hid-lg4ff.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/hid/hid-lg4ff.c') diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 65a6ec8..7da40a1 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -202,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; @@ -225,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 */ @@ -245,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 */ @@ -265,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 */ @@ -294,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; @@ -306,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; } @@ -320,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) @@ -334,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); } } @@ -410,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, -- cgit v1.1 From d991938a807a63c58c9c0fa6cd05cd2490aa6993 Mon Sep 17 00:00:00 2001 From: Simon Wood Date: Fri, 26 Apr 2013 19:29:54 -0600 Subject: HID: hid-lg4ff add support for new version of DFGT wheel It has been reported that there is a new version (different USB rev) of the Logitech DFGT in the 'wild'. This patch allows the kernel to recognise this wheel and send it the command to enter native mode. Reported-by: "Denis Jovic" Signed-off-by: Simon Wood Signed-off-by: Jiri Kosina --- drivers/hid/hid-lg4ff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/hid/hid-lg4ff.c') diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 65a6ec8..2dd7360 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -34,6 +34,7 @@ #define DFGT_REV_MAJ 0x13 #define DFGT_REV_MIN 0x22 +#define DFGT2_REV_MIN 0x26 #define DFP_REV_MAJ 0x11 #define DFP_REV_MIN 0x06 #define FFEX_REV_MAJ 0x21 @@ -125,6 +126,7 @@ static const struct lg4ff_native_cmd native_g27 = { static const struct lg4ff_usb_revision lg4ff_revs[] = { {DFGT_REV_MAJ, DFGT_REV_MIN, &native_dfgt}, /* Driving Force GT */ + {DFGT_REV_MAJ, DFGT2_REV_MIN, &native_dfgt}, /* Driving Force GT v2 */ {DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */ {G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */ {G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */ -- cgit v1.1