aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/usbhid/Kconfig13
-rw-r--r--drivers/hid/usbhid/Makefile3
-rw-r--r--drivers/hid/usbhid/hid-core.c2
-rw-r--r--drivers/hid/usbhid/hid-ff.c69
-rw-r--r--include/linux/hid.h9
5 files changed, 2 insertions, 94 deletions
diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig
index 3cfc076f5f71..5d9aa95fc3ef 100644
--- a/drivers/hid/usbhid/Kconfig
+++ b/drivers/hid/usbhid/Kconfig
@@ -24,21 +24,8 @@ config USB_HID
24comment "Input core support is needed for USB HID input layer or HIDBP support" 24comment "Input core support is needed for USB HID input layer or HIDBP support"
25 depends on USB_HID && INPUT=n 25 depends on USB_HID && INPUT=n
26 26
27config HID_FF
28 bool "Force feedback support (EXPERIMENTAL)"
29 depends on USB_HID && EXPERIMENTAL
30 help
31 Say Y here is you want force feedback support for a few HID devices.
32 See below for a list of supported devices.
33
34 See <file:Documentation/input/ff.txt> for a description of the force
35 feedback API.
36
37 If unsure, say N.
38
39config HID_PID 27config HID_PID
40 bool "PID device support" 28 bool "PID device support"
41 depends on HID_FF
42 help 29 help
43 Say Y here if you have a PID-compliant device and wish to enable force 30 Say Y here if you have a PID-compliant device and wish to enable force
44 feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such 31 feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
diff --git a/drivers/hid/usbhid/Makefile b/drivers/hid/usbhid/Makefile
index 5c460fcdd75c..1329ecb37a1c 100644
--- a/drivers/hid/usbhid/Makefile
+++ b/drivers/hid/usbhid/Makefile
@@ -13,9 +13,6 @@ endif
13ifeq ($(CONFIG_HID_PID),y) 13ifeq ($(CONFIG_HID_PID),y)
14 usbhid-objs += hid-pidff.o 14 usbhid-objs += hid-pidff.o
15endif 15endif
16ifeq ($(CONFIG_HID_FF),y)
17 usbhid-objs += hid-ff.o
18endif
19 16
20obj-$(CONFIG_USB_HID) += usbhid.o 17obj-$(CONFIG_USB_HID) += usbhid.o
21obj-$(CONFIG_USB_KBD) += usbkbd.o 18obj-$(CONFIG_USB_KBD) += usbkbd.o
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 4ec10aa618db..07840df56c63 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -935,7 +935,7 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
935 usb_set_intfdata(intf, hid); 935 usb_set_intfdata(intf, hid);
936 hid->ll_driver = &usb_hid_driver; 936 hid->ll_driver = &usb_hid_driver;
937 hid->hid_output_raw_report = usbhid_output_raw_report; 937 hid->hid_output_raw_report = usbhid_output_raw_report;
938 hid->ff_init = hid_ff_init; 938 hid->ff_init = hid_pidff_init;
939#ifdef CONFIG_USB_HIDDEV 939#ifdef CONFIG_USB_HIDDEV
940 hid->hiddev_connect = hiddev_connect; 940 hid->hiddev_connect = hiddev_connect;
941 hid->hiddev_hid_event = hiddev_hid_event; 941 hid->hiddev_hid_event = hiddev_hid_event;
diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c
deleted file mode 100644
index eca01a6fda59..000000000000
--- a/drivers/hid/usbhid/hid-ff.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Force feedback support for hid devices.
3 * Not all hid devices use the same protocol. For example, some use PID,
4 * other use their own proprietary procotol.
5 *
6 * Copyright (c) 2002-2004 Johann Deneux
7 */
8
9/*
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * Should you need to contact me, the author, you can do so by
25 * e-mail - mail your message to <johann.deneux@it.uu.se>
26 */
27
28#include <linux/input.h>
29
30#undef DEBUG
31#include <linux/usb.h>
32
33#include <linux/hid.h>
34#include "usbhid.h"
35
36/*
37 * This table contains pointers to initializers. To add support for new
38 * devices, you need to add the USB vendor and product ids here.
39 */
40struct hid_ff_initializer {
41 u16 idVendor;
42 u16 idProduct;
43 int (*init)(struct hid_device*);
44};
45
46/*
47 * We try pidff when no other driver is found because PID is the
48 * standards compliant way of implementing force feedback in HID.
49 * pidff_init() will quickly abort if the device doesn't appear to
50 * be a PID device
51 */
52static struct hid_ff_initializer inits[] = {
53 { 0, 0, hid_pidff_init} /* Matches anything */
54};
55
56int hid_ff_init(struct hid_device* hid)
57{
58 struct hid_ff_initializer *init;
59 int vendor = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idVendor);
60 int product = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idProduct);
61
62 for (init = inits; init->idVendor; init++)
63 if (init->idVendor == vendor && init->idProduct == product)
64 break;
65
66 return init->init(hid);
67}
68EXPORT_SYMBOL_GPL(hid_ff_init);
69
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 0773ba6a66f2..dcdef0bb4bba 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -757,17 +757,10 @@ int usbhid_quirks_init(char **quirks_param);
757void usbhid_quirks_exit(void); 757void usbhid_quirks_exit(void);
758void usbhid_set_leds(struct hid_device *hid); 758void usbhid_set_leds(struct hid_device *hid);
759 759
760#ifdef CONFIG_HID_FF
761int hid_ff_init(struct hid_device *hid);
762
763#ifdef CONFIG_HID_PID 760#ifdef CONFIG_HID_PID
764int hid_pidff_init(struct hid_device *hid); 761int hid_pidff_init(struct hid_device *hid);
765#else 762#else
766static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } 763#define hid_pidff_init NULL
767#endif
768
769#else
770#define hid_ff_init NULL
771#endif 764#endif
772 765
773#ifdef CONFIG_HID_DEBUG 766#ifdef CONFIG_HID_DEBUG