aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-axff.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 13:35:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 13:35:30 -0400
commit7fd23a24717a327a66f3c32d11a20a2f169c824f (patch)
tree62a731f3edac9e58427fc27396ad5da8804fa579 /drivers/hid/hid-axff.c
parent0a95d92c0054e74fb79607ac2df958b7bf295706 (diff)
parent65b06194c9c9f41bc07ac6a6d42edb4b9e43fea4 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (48 commits) HID: add support for Logitech Driving Force Pro wheel HID: hid-ortek: remove spurious reference HID: add support for Ortek PKB-1700 HID: roccat-koneplus: vorrect mode of sysfs attr 'sensor' HID: hid-ntrig: init settle and mode check HID: merge hid-egalax into hid-multitouch HID: hid-multitouch: Send events per slot if CONTACTCOUNT is missing HID: ntrig remove if and drop an indent HID: ACRUX - activate the device immediately after binding HID: ntrig: apply NO_INIT_REPORTS quirk HID: hid-magicmouse: Correct touch orientation direction HID: ntrig don't dereference unclaimed hidinput HID: Do not create input devices for feature reports HID: bt hidp: send Output reports using SET_REPORT on the Control channel HID: hid-sony.c: Fix sending Output reports to the Sixaxis HID: add support for Keytouch IEC 60945 HID: Add HID Report Descriptor to sysfs HID: add IRTOUCH infrared USB to hid_have_special_driver HID: kernel oops in out_cleanup in function hidinput_connect HID: Add teletext/color keys - gyration remote - EU version (GYAR3101CKDE) ...
Diffstat (limited to 'drivers/hid/hid-axff.c')
-rw-r--r--drivers/hid/hid-axff.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c
index e5b961d6ff22..b4554288de00 100644
--- a/drivers/hid/hid-axff.c
+++ b/drivers/hid/hid-axff.c
@@ -33,6 +33,8 @@
33#include <linux/hid.h> 33#include <linux/hid.h>
34 34
35#include "hid-ids.h" 35#include "hid-ids.h"
36
37#ifdef CONFIG_HID_ACRUX_FF
36#include "usbhid/usbhid.h" 38#include "usbhid/usbhid.h"
37 39
38struct axff_device { 40struct axff_device {
@@ -109,6 +111,12 @@ err_free_mem:
109 kfree(axff); 111 kfree(axff);
110 return error; 112 return error;
111} 113}
114#else
115static inline int axff_init(struct hid_device *hid)
116{
117 return 0;
118}
119#endif
112 120
113static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id) 121static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id)
114{ 122{
@@ -139,9 +147,25 @@ static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id)
139 error); 147 error);
140 } 148 }
141 149
150 /*
151 * We need to start polling device right away, otherwise
152 * it will go into a coma.
153 */
154 error = hid_hw_open(hdev);
155 if (error) {
156 dev_err(&hdev->dev, "hw open failed\n");
157 return error;
158 }
159
142 return 0; 160 return 0;
143} 161}
144 162
163static void ax_remove(struct hid_device *hdev)
164{
165 hid_hw_close(hdev);
166 hid_hw_stop(hdev);
167}
168
145static const struct hid_device_id ax_devices[] = { 169static const struct hid_device_id ax_devices[] = {
146 { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802), }, 170 { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802), },
147 { } 171 { }
@@ -149,9 +173,10 @@ static const struct hid_device_id ax_devices[] = {
149MODULE_DEVICE_TABLE(hid, ax_devices); 173MODULE_DEVICE_TABLE(hid, ax_devices);
150 174
151static struct hid_driver ax_driver = { 175static struct hid_driver ax_driver = {
152 .name = "acrux", 176 .name = "acrux",
153 .id_table = ax_devices, 177 .id_table = ax_devices,
154 .probe = ax_probe, 178 .probe = ax_probe,
179 .remove = ax_remove,
155}; 180};
156 181
157static int __init ax_init(void) 182static int __init ax_init(void)