aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-axff.c
diff options
context:
space:
mode:
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)