diff options
author | Benjamin Tissoires <benjamin.tissoires@gmail.com> | 2013-02-25 05:31:46 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-02-25 07:26:41 -0500 |
commit | d881427253da011495f4193663d809d0e9dfa215 (patch) | |
tree | fe4eb817ab712f7049b1d3ef675fec69d9207675 /drivers/hid/hid-gaff.c | |
parent | f3757cea18fadce23c95a4c4bc3123af73a95e65 (diff) |
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 <benjamin.tissoires@gmail.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
For the sensor-hub part:
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-gaff.c')
-rw-r--r-- | drivers/hid/hid-gaff.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c index 04d2e6aca778..2d8cead3adca 100644 --- a/drivers/hid/hid-gaff.c +++ b/drivers/hid/hid-gaff.c | |||
@@ -29,13 +29,11 @@ | |||
29 | 29 | ||
30 | #include <linux/input.h> | 30 | #include <linux/input.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/usb.h> | ||
33 | #include <linux/hid.h> | 32 | #include <linux/hid.h> |
34 | #include <linux/module.h> | 33 | #include <linux/module.h> |
35 | #include "hid-ids.h" | 34 | #include "hid-ids.h" |
36 | 35 | ||
37 | #ifdef CONFIG_GREENASIA_FF | 36 | #ifdef CONFIG_GREENASIA_FF |
38 | #include "usbhid/usbhid.h" | ||
39 | 37 | ||
40 | struct gaff_device { | 38 | struct gaff_device { |
41 | struct hid_report *report; | 39 | struct hid_report *report; |
@@ -63,14 +61,14 @@ static int hid_gaff_play(struct input_dev *dev, void *data, | |||
63 | gaff->report->field[0]->value[4] = left; | 61 | gaff->report->field[0]->value[4] = left; |
64 | gaff->report->field[0]->value[5] = 0; | 62 | gaff->report->field[0]->value[5] = 0; |
65 | dbg_hid("running with 0x%02x 0x%02x", left, right); | 63 | dbg_hid("running with 0x%02x 0x%02x", left, right); |
66 | usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 64 | hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
67 | 65 | ||
68 | gaff->report->field[0]->value[0] = 0xfa; | 66 | gaff->report->field[0]->value[0] = 0xfa; |
69 | gaff->report->field[0]->value[1] = 0xfe; | 67 | gaff->report->field[0]->value[1] = 0xfe; |
70 | gaff->report->field[0]->value[2] = 0x0; | 68 | gaff->report->field[0]->value[2] = 0x0; |
71 | gaff->report->field[0]->value[4] = 0x0; | 69 | gaff->report->field[0]->value[4] = 0x0; |
72 | 70 | ||
73 | usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 71 | hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
74 | 72 | ||
75 | return 0; | 73 | return 0; |
76 | } | 74 | } |
@@ -122,12 +120,12 @@ static int gaff_init(struct hid_device *hid) | |||
122 | gaff->report->field[0]->value[1] = 0x00; | 120 | gaff->report->field[0]->value[1] = 0x00; |
123 | gaff->report->field[0]->value[2] = 0x00; | 121 | gaff->report->field[0]->value[2] = 0x00; |
124 | gaff->report->field[0]->value[3] = 0x00; | 122 | gaff->report->field[0]->value[3] = 0x00; |
125 | usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 123 | hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
126 | 124 | ||
127 | gaff->report->field[0]->value[0] = 0xfa; | 125 | gaff->report->field[0]->value[0] = 0xfa; |
128 | gaff->report->field[0]->value[1] = 0xfe; | 126 | gaff->report->field[0]->value[1] = 0xfe; |
129 | 127 | ||
130 | usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 128 | hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT); |
131 | 129 | ||
132 | hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n"); | 130 | hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n"); |
133 | 131 | ||