forked from analogdevicesinc/linux
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> For the sensor-hub part: Tested-by: Mika Westerberg <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
- Loading branch information
Showing
34 changed files
with
111 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,14 +29,12 @@ | |
|
||
#include <linux/input.h> | ||
#include <linux/slab.h> | ||
#include <linux/usb.h> | ||
#include <linux/hid.h> | ||
#include <linux/module.h> | ||
|
||
#include "hid-ids.h" | ||
|
||
#ifdef CONFIG_HID_ACRUX_FF | ||
#include "usbhid/usbhid.h" | ||
|
||
struct axff_device { | ||
struct hid_report *report; | ||
|
@@ -68,7 +66,7 @@ static int axff_play(struct input_dev *dev, void *data, struct ff_effect *effect | |
} | ||
|
||
dbg_hid("running with 0x%02x 0x%02x", left, right); | ||
usbhid_submit_report(hid, axff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT); | ||
|
||
return 0; | ||
} | ||
|
@@ -114,7 +112,7 @@ static int axff_init(struct hid_device *hid) | |
goto err_free_mem; | ||
|
||
axff->report = report; | ||
usbhid_submit_report(hid, axff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT); | ||
|
||
hid_info(hid, "Force Feedback for ACRUX game controllers by Sergei Kolzun <[email protected]>\n"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,14 +29,12 @@ | |
|
||
#include <linux/input.h> | ||
#include <linux/slab.h> | ||
#include <linux/usb.h> | ||
#include <linux/hid.h> | ||
#include <linux/module.h> | ||
|
||
#include "hid-ids.h" | ||
|
||
#ifdef CONFIG_DRAGONRISE_FF | ||
#include "usbhid/usbhid.h" | ||
|
||
struct drff_device { | ||
struct hid_report *report; | ||
|
@@ -68,7 +66,7 @@ static int drff_play(struct input_dev *dev, void *data, | |
drff->report->field[0]->value[1] = 0x00; | ||
drff->report->field[0]->value[2] = weak; | ||
drff->report->field[0]->value[4] = strong; | ||
usbhid_submit_report(hid, drff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT); | ||
|
||
drff->report->field[0]->value[0] = 0xfa; | ||
drff->report->field[0]->value[1] = 0xfe; | ||
|
@@ -80,7 +78,7 @@ static int drff_play(struct input_dev *dev, void *data, | |
drff->report->field[0]->value[2] = 0x00; | ||
drff->report->field[0]->value[4] = 0x00; | ||
dbg_hid("running with 0x%02x 0x%02x", strong, weak); | ||
usbhid_submit_report(hid, drff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT); | ||
|
||
return 0; | ||
} | ||
|
@@ -132,7 +130,7 @@ static int drff_init(struct hid_device *hid) | |
drff->report->field[0]->value[4] = 0x00; | ||
drff->report->field[0]->value[5] = 0x00; | ||
drff->report->field[0]->value[6] = 0x00; | ||
usbhid_submit_report(hid, drff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT); | ||
|
||
hid_info(hid, "Force Feedback for DragonRise Inc. " | ||
"game controllers by Richard Walmsley <[email protected]>\n"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,9 @@ | |
|
||
#include <linux/hid.h> | ||
#include <linux/input.h> | ||
#include <linux/usb.h> | ||
#include <linux/module.h> | ||
|
||
#include "hid-ids.h" | ||
#include "usbhid/usbhid.h" | ||
|
||
struct emsff_device { | ||
struct hid_report *report; | ||
|
@@ -52,7 +50,7 @@ static int emsff_play(struct input_dev *dev, void *data, | |
emsff->report->field[0]->value[2] = strong; | ||
|
||
dbg_hid("running with 0x%02x 0x%02x\n", strong, weak); | ||
usbhid_submit_report(hid, emsff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT); | ||
|
||
return 0; | ||
} | ||
|
@@ -104,7 +102,7 @@ static int emsff_init(struct hid_device *hid) | |
emsff->report->field[0]->value[4] = 0x00; | ||
emsff->report->field[0]->value[5] = 0x00; | ||
emsff->report->field[0]->value[6] = 0x00; | ||
usbhid_submit_report(hid, emsff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT); | ||
|
||
hid_info(hid, "force feedback for EMS based devices by Ignaz Forster <[email protected]>\n"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,13 +29,11 @@ | |
|
||
#include <linux/input.h> | ||
#include <linux/slab.h> | ||
#include <linux/usb.h> | ||
#include <linux/hid.h> | ||
#include <linux/module.h> | ||
#include "hid-ids.h" | ||
|
||
#ifdef CONFIG_GREENASIA_FF | ||
#include "usbhid/usbhid.h" | ||
|
||
struct gaff_device { | ||
struct hid_report *report; | ||
|
@@ -63,14 +61,14 @@ static int hid_gaff_play(struct input_dev *dev, void *data, | |
gaff->report->field[0]->value[4] = left; | ||
gaff->report->field[0]->value[5] = 0; | ||
dbg_hid("running with 0x%02x 0x%02x", left, right); | ||
usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); | ||
|
||
gaff->report->field[0]->value[0] = 0xfa; | ||
gaff->report->field[0]->value[1] = 0xfe; | ||
gaff->report->field[0]->value[2] = 0x0; | ||
gaff->report->field[0]->value[4] = 0x0; | ||
|
||
usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); | ||
|
||
return 0; | ||
} | ||
|
@@ -122,12 +120,12 @@ static int gaff_init(struct hid_device *hid) | |
gaff->report->field[0]->value[1] = 0x00; | ||
gaff->report->field[0]->value[2] = 0x00; | ||
gaff->report->field[0]->value[3] = 0x00; | ||
usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); | ||
|
||
gaff->report->field[0]->value[0] = 0xfa; | ||
gaff->report->field[0]->value[1] = 0xfe; | ||
|
||
usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); | ||
|
||
hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <[email protected]>\n"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,10 @@ | |
#include <linux/input.h> | ||
#include <linux/module.h> | ||
#include <linux/slab.h> | ||
#include <linux/usb.h> | ||
|
||
#include "hid-ids.h" | ||
|
||
#ifdef CONFIG_HOLTEK_FF | ||
#include "usbhid/usbhid.h" | ||
|
||
MODULE_LICENSE("GPL"); | ||
MODULE_AUTHOR("Anssi Hannula <[email protected]>"); | ||
|
@@ -102,7 +100,7 @@ static void holtekff_send(struct holtekff_device *holtekff, | |
|
||
dbg_hid("sending %*ph\n", 7, data); | ||
|
||
usbhid_submit_report(hid, holtekff->field->report, USB_DIR_OUT); | ||
hid_hw_request(hid, holtekff->field->report, HID_REQ_SET_REPORT); | ||
} | ||
|
||
static int holtekff_play(struct input_dev *dev, void *data, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,8 @@ | |
|
||
#include <linux/input.h> | ||
#include <linux/slab.h> | ||
#include <linux/usb.h> | ||
#include <linux/hid.h> | ||
|
||
#include "usbhid/usbhid.h" | ||
#include "hid-lg.h" | ||
|
||
struct lg2ff_device { | ||
|
@@ -56,7 +54,7 @@ static int play_effect(struct input_dev *dev, void *data, | |
lg2ff->report->field[0]->value[4] = 0x00; | ||
} | ||
|
||
usbhid_submit_report(hid, lg2ff->report, USB_DIR_OUT); | ||
hid_hw_request(hid, lg2ff->report, HID_REQ_SET_REPORT); | ||
return 0; | ||
} | ||
|
||
|
@@ -108,7 +106,7 @@ int lg2ff_init(struct hid_device *hid) | |
report->field[0]->value[5] = 0x00; | ||
report->field[0]->value[6] = 0x00; | ||
|
||
usbhid_submit_report(hid, report, USB_DIR_OUT); | ||
hid_hw_request(hid, report, HID_REQ_SET_REPORT); | ||
|
||
hid_info(hid, "Force feedback for Logitech RumblePad/Rumblepad 2 by Anssi Hannula <[email protected]>\n"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.