diff options
author | Benjamin Tissoires <benjamin.tissoires@gmail.com> | 2013-02-25 05:31:47 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-02-25 07:26:41 -0500 |
commit | b7966a4d7be0a10329f03330390f4bdaf453d74a (patch) | |
tree | 73e1456d2199e16edf22af60929507ae25cff281 /drivers/hid/usbhid/hid-pidff.c | |
parent | d881427253da011495f4193663d809d0e9dfa215 (diff) |
HID: use hid_hw_wait() instead of direct call to usbhid
This removes most of the dependencies between hid drivers and usbhid.
The patch was constructed by replacing all occurences of
usbhid_wait_io() by its hid_hw_wait() counterpart.
Then, drivers not requiring USB_HID anymore have their USB_HID
dependency cleaned in the Kconfig file.
As of today, few drivers are still requiring an explicit USB layer
dependency:
* ntrig (a patch is on its way)
* multitouch (one patch following and another on its way)
* lenovo tpkbd
* roccat
* sony
The last three are two deeply using direct calls to the usb subsystem
to be able to be cleaned right now.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid/hid-pidff.c')
-rw-r--r-- | drivers/hid/usbhid/hid-pidff.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index 0f1efa39ec46..10b616702780 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c | |||
@@ -471,13 +471,13 @@ static int pidff_request_effect_upload(struct pidff_device *pidff, int efnum) | |||
471 | 471 | ||
472 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] = 0; | 472 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] = 0; |
473 | pidff->block_load_status->value[0] = 0; | 473 | pidff->block_load_status->value[0] = 0; |
474 | usbhid_wait_io(pidff->hid); | 474 | hid_hw_wait(pidff->hid); |
475 | 475 | ||
476 | for (j = 0; j < 60; j++) { | 476 | for (j = 0; j < 60; j++) { |
477 | hid_dbg(pidff->hid, "pid_block_load requested\n"); | 477 | hid_dbg(pidff->hid, "pid_block_load requested\n"); |
478 | hid_hw_request(pidff->hid, pidff->reports[PID_BLOCK_LOAD], | 478 | hid_hw_request(pidff->hid, pidff->reports[PID_BLOCK_LOAD], |
479 | HID_REQ_GET_REPORT); | 479 | HID_REQ_GET_REPORT); |
480 | usbhid_wait_io(pidff->hid); | 480 | hid_hw_wait(pidff->hid); |
481 | if (pidff->block_load_status->value[0] == | 481 | if (pidff->block_load_status->value[0] == |
482 | pidff->status_id[PID_BLOCK_LOAD_SUCCESS]) { | 482 | pidff->status_id[PID_BLOCK_LOAD_SUCCESS]) { |
483 | hid_dbg(pidff->hid, "device reported free memory: %d bytes\n", | 483 | hid_dbg(pidff->hid, "device reported free memory: %d bytes\n", |
@@ -551,7 +551,7 @@ static int pidff_erase_effect(struct input_dev *dev, int effect_id) | |||
551 | effect_id, pidff->pid_id[effect_id]); | 551 | effect_id, pidff->pid_id[effect_id]); |
552 | /* Wait for the queue to clear. We do not want a full fifo to | 552 | /* Wait for the queue to clear. We do not want a full fifo to |
553 | prevent the effect removal. */ | 553 | prevent the effect removal. */ |
554 | usbhid_wait_io(pidff->hid); | 554 | hid_hw_wait(pidff->hid); |
555 | pidff_playback_pid(pidff, pid_id, 0); | 555 | pidff_playback_pid(pidff, pid_id, 0); |
556 | pidff_erase_pid(pidff, pid_id); | 556 | pidff_erase_pid(pidff, pid_id); |
557 | 557 | ||
@@ -1159,18 +1159,18 @@ static void pidff_reset(struct pidff_device *pidff) | |||
1159 | pidff->device_control->value[0] = pidff->control_id[PID_RESET]; | 1159 | pidff->device_control->value[0] = pidff->control_id[PID_RESET]; |
1160 | /* We reset twice as sometimes hid_wait_io isn't waiting long enough */ | 1160 | /* We reset twice as sometimes hid_wait_io isn't waiting long enough */ |
1161 | hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); | 1161 | hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); |
1162 | usbhid_wait_io(hid); | 1162 | hid_hw_wait(hid); |
1163 | hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); | 1163 | hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); |
1164 | usbhid_wait_io(hid); | 1164 | hid_hw_wait(hid); |
1165 | 1165 | ||
1166 | pidff->device_control->value[0] = | 1166 | pidff->device_control->value[0] = |
1167 | pidff->control_id[PID_ENABLE_ACTUATORS]; | 1167 | pidff->control_id[PID_ENABLE_ACTUATORS]; |
1168 | hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); | 1168 | hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT); |
1169 | usbhid_wait_io(hid); | 1169 | hid_hw_wait(hid); |
1170 | 1170 | ||
1171 | /* pool report is sometimes messed up, refetch it */ | 1171 | /* pool report is sometimes messed up, refetch it */ |
1172 | hid_hw_request(hid, pidff->reports[PID_POOL], HID_REQ_GET_REPORT); | 1172 | hid_hw_request(hid, pidff->reports[PID_POOL], HID_REQ_GET_REPORT); |
1173 | usbhid_wait_io(hid); | 1173 | hid_hw_wait(hid); |
1174 | 1174 | ||
1175 | if (pidff->pool[PID_SIMULTANEOUS_MAX].value) { | 1175 | if (pidff->pool[PID_SIMULTANEOUS_MAX].value) { |
1176 | while (pidff->pool[PID_SIMULTANEOUS_MAX].value[0] < 2) { | 1176 | while (pidff->pool[PID_SIMULTANEOUS_MAX].value[0] < 2) { |
@@ -1183,7 +1183,7 @@ static void pidff_reset(struct pidff_device *pidff) | |||
1183 | hid_dbg(pidff->hid, "pid_pool requested again\n"); | 1183 | hid_dbg(pidff->hid, "pid_pool requested again\n"); |
1184 | hid_hw_request(hid, pidff->reports[PID_POOL], | 1184 | hid_hw_request(hid, pidff->reports[PID_POOL], |
1185 | HID_REQ_GET_REPORT); | 1185 | HID_REQ_GET_REPORT); |
1186 | usbhid_wait_io(hid); | 1186 | hid_hw_wait(hid); |
1187 | } | 1187 | } |
1188 | } | 1188 | } |
1189 | } | 1189 | } |