aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sensor-hub.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@gmail.com>2013-02-25 05:31:46 -0500
committerJiri Kosina <jkosina@suse.cz>2013-02-25 07:26:41 -0500
commitd881427253da011495f4193663d809d0e9dfa215 (patch)
treefe4eb817ab712f7049b1d3ef675fec69d9207675 /drivers/hid/hid-sensor-hub.c
parentf3757cea18fadce23c95a4c4bc3123af73a95e65 (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-sensor-hub.c')
-rw-r--r--drivers/hid/hid-sensor-hub.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 6679788bf75a..59d29f853ac0 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -18,7 +18,6 @@
18 */ 18 */
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/hid.h> 20#include <linux/hid.h>
21#include <linux/usb.h>
22#include "usbhid/usbhid.h" 21#include "usbhid/usbhid.h"
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
@@ -204,7 +203,7 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
204 goto done_proc; 203 goto done_proc;
205 } 204 }
206 hid_set_field(report->field[field_index], 0, value); 205 hid_set_field(report->field[field_index], 0, value);
207 usbhid_submit_report(hsdev->hdev, report, USB_DIR_OUT); 206 hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT);
208 usbhid_wait_io(hsdev->hdev); 207 usbhid_wait_io(hsdev->hdev);
209 208
210done_proc: 209done_proc:
@@ -227,7 +226,7 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
227 ret = -EINVAL; 226 ret = -EINVAL;
228 goto done_proc; 227 goto done_proc;
229 } 228 }
230 usbhid_submit_report(hsdev->hdev, report, USB_DIR_IN); 229 hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
231 usbhid_wait_io(hsdev->hdev); 230 usbhid_wait_io(hsdev->hdev);
232 *value = report->field[field_index]->value[0]; 231 *value = report->field[field_index]->value[0];
233 232
@@ -262,7 +261,7 @@ int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
262 spin_unlock_irqrestore(&data->lock, flags); 261 spin_unlock_irqrestore(&data->lock, flags);
263 goto err_free; 262 goto err_free;
264 } 263 }
265 usbhid_submit_report(hsdev->hdev, report, USB_DIR_IN); 264 hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
266 spin_unlock_irqrestore(&data->lock, flags); 265 spin_unlock_irqrestore(&data->lock, flags);
267 wait_for_completion_interruptible_timeout(&data->pending.ready, HZ*5); 266 wait_for_completion_interruptible_timeout(&data->pending.ready, HZ*5);
268 switch (data->pending.raw_size) { 267 switch (data->pending.raw_size) {