aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-09-18 06:23:32 -0400
committerJiri Kosina <jkosina@suse.cz>2008-10-14 17:51:01 -0400
commit987fbc1f7d446f4bf7063d3b756ae29db80be75e (patch)
tree84e4057e429857b9a624b612b1180798c7893268
parent10e41a711e55f485709b4ca157e587cf36ef5a69 (diff)
HID: move zeroplus FF processing
Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/Kconfig8
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-core.c2
-rw-r--r--drivers/hid/hid-dummy.c3
-rw-r--r--drivers/hid/hid-ids.h2
-rw-r--r--drivers/hid/hid-zpff.c (renamed from drivers/hid/usbhid/hid-zpff.c)65
-rw-r--r--drivers/hid/usbhid/Kconfig8
-rw-r--r--drivers/hid/usbhid/Makefile3
-rw-r--r--drivers/hid/usbhid/hid-ff.c4
-rw-r--r--include/linux/hid.h1
10 files changed, 76 insertions, 21 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 78e3ba9504f3..fc4f80c4006c 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -252,6 +252,14 @@ config THRUSTMASTER_FF
252 Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or 252 Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
253 a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel. 253 a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel.
254 254
255config ZEROPLUS_FF
256 tristate "Zeroplus based game controller support"
257 default m
258 depends on USB_HID
259 select INPUT_FF_MEMLESS
260 help
261 Say Y here if you have a Zeroplus based game controller.
262
255endmenu 263endmenu
256 264
257endif # HID_SUPPORT 265endif # HID_SUPPORT
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 9bd6daf6aaa4..767f29500716 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
38obj-$(CONFIG_HID_SONY) += hid-sony.o 38obj-$(CONFIG_HID_SONY) += hid-sony.o
39obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o 39obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o
40obj-$(CONFIG_THRUSTMASTER_FF) += hid-tmff.o 40obj-$(CONFIG_THRUSTMASTER_FF) += hid-tmff.o
41obj-$(CONFIG_ZEROPLUS_FF) += hid-zpff.o
41 42
42obj-$(CONFIG_USB_HID) += usbhid/ 43obj-$(CONFIG_USB_HID) += usbhid/
43obj-$(CONFIG_USB_MOUSE) += usbhid/ 44obj-$(CONFIG_USB_MOUSE) += usbhid/
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index b0996ff1462b..5a23077175e6 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1530,6 +1530,8 @@ static const struct hid_device_id hid_ignore_list[] = {
1530 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, 1530 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) },
1531 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, 1531 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) },
1532 { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, 1532 { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
1533 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
1534 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
1533 { } 1535 { }
1534}; 1536};
1535 1537
diff --git a/drivers/hid/hid-dummy.c b/drivers/hid/hid-dummy.c
index ae122a122faa..54d1fb6fd4d8 100644
--- a/drivers/hid/hid-dummy.c
+++ b/drivers/hid/hid-dummy.c
@@ -58,6 +58,9 @@ static int __init hid_dummy_init(void)
58#ifdef CONFIG_THRUSTMASTER_FF_MODULE 58#ifdef CONFIG_THRUSTMASTER_FF_MODULE
59 HID_COMPAT_CALL_DRIVER(thrustmaster); 59 HID_COMPAT_CALL_DRIVER(thrustmaster);
60#endif 60#endif
61#ifdef CONFIG_ZEROPLUS_FF_MODULE
62 HID_COMPAT_CALL_DRIVER(zeroplus);
63#endif
61 64
62 return -EIO; 65 return -EIO;
63} 66}
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index b8cc0196ec00..e68b6d9bcd1a 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -388,6 +388,8 @@
388#define USB_VENDOR_ID_YEALINK 0x6993 388#define USB_VENDOR_ID_YEALINK 0x6993
389#define USB_DEVICE_ID_YEALINK_P1K_P4K_B2K 0xb001 389#define USB_DEVICE_ID_YEALINK_P1K_P4K_B2K 0xb001
390 390
391#define USB_VENDOR_ID_ZEROPLUS 0x0c12
392
391#define USB_VENDOR_ID_KYE 0x0458 393#define USB_VENDOR_ID_KYE 0x0458
392#define USB_DEVICE_ID_KYE_GPEN_560 0x5003 394#define USB_DEVICE_ID_KYE_GPEN_560 0x5003
393 395
diff --git a/drivers/hid/usbhid/hid-zpff.c b/drivers/hid/hid-zpff.c
index 5a688274f6a3..9ed04ee9d642 100644
--- a/drivers/hid/usbhid/hid-zpff.c
+++ b/drivers/hid/hid-zpff.c
@@ -21,16 +21,19 @@
21 */ 21 */
22 22
23 23
24#include <linux/hid.h>
24#include <linux/input.h> 25#include <linux/input.h>
25#include <linux/usb.h> 26#include <linux/usb.h>
26#include <linux/hid.h> 27
27#include "usbhid.h" 28#include "hid-ids.h"
29
30#include "usbhid/usbhid.h"
28 31
29struct zpff_device { 32struct zpff_device {
30 struct hid_report *report; 33 struct hid_report *report;
31}; 34};
32 35
33static int hid_zpff_play(struct input_dev *dev, void *data, 36static int zpff_play(struct input_dev *dev, void *data,
34 struct ff_effect *effect) 37 struct ff_effect *effect)
35{ 38{
36 struct hid_device *hid = input_get_drvdata(dev); 39 struct hid_device *hid = input_get_drvdata(dev);
@@ -58,7 +61,7 @@ static int hid_zpff_play(struct input_dev *dev, void *data,
58 return 0; 61 return 0;
59} 62}
60 63
61int hid_zpff_init(struct hid_device *hid) 64static int zpff_init(struct hid_device *hid)
62{ 65{
63 struct zpff_device *zpff; 66 struct zpff_device *zpff;
64 struct hid_report *report; 67 struct hid_report *report;
@@ -87,7 +90,7 @@ int hid_zpff_init(struct hid_device *hid)
87 90
88 set_bit(FF_RUMBLE, dev->ffbit); 91 set_bit(FF_RUMBLE, dev->ffbit);
89 92
90 error = input_ff_create_memless(dev, zpff, hid_zpff_play); 93 error = input_ff_create_memless(dev, zpff, zpff_play);
91 if (error) { 94 if (error) {
92 kfree(zpff); 95 kfree(zpff);
93 return error; 96 return error;
@@ -105,3 +108,55 @@ int hid_zpff_init(struct hid_device *hid)
105 108
106 return 0; 109 return 0;
107} 110}
111
112static int zp_probe(struct hid_device *hdev, const struct hid_device_id *id)
113{
114 int ret;
115
116 ret = hid_parse(hdev);
117 if (ret) {
118 dev_err(&hdev->dev, "parse failed\n");
119 goto err;
120 }
121
122 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
123 if (ret) {
124 dev_err(&hdev->dev, "hw start failed\n");
125 goto err;
126 }
127
128 zpff_init(hdev);
129
130 return 0;
131err:
132 return ret;
133}
134
135static const struct hid_device_id zp_devices[] = {
136 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
137 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
138 { }
139};
140MODULE_DEVICE_TABLE(hid, zp_devices);
141
142static struct hid_driver zp_driver = {
143 .name = "zeroplus",
144 .id_table = zp_devices,
145 .probe = zp_probe,
146};
147
148static int zp_init(void)
149{
150 return hid_register_driver(&zp_driver);
151}
152
153static void zp_exit(void)
154{
155 hid_unregister_driver(&zp_driver);
156}
157
158module_init(zp_init);
159module_exit(zp_exit);
160MODULE_LICENSE("GPL");
161
162HID_COMPAT_LOAD_DRIVER(zeroplus);
diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig
index c236fb3deb59..3cfc076f5f71 100644
--- a/drivers/hid/usbhid/Kconfig
+++ b/drivers/hid/usbhid/Kconfig
@@ -44,14 +44,6 @@ config HID_PID
44 feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such 44 feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
45 devices. 45 devices.
46 46
47config ZEROPLUS_FF
48 bool "Zeroplus based game controller support"
49 depends on HID_FF
50 select INPUT_FF_MEMLESS if USB_HID
51 help
52 Say Y here if you have a Zeroplus based game controller and want to
53 enable force feedback for it.
54
55config USB_HIDDEV 47config USB_HIDDEV
56 bool "/dev/hiddev raw HID device support" 48 bool "/dev/hiddev raw HID device support"
57 depends on USB_HID 49 depends on USB_HID
diff --git a/drivers/hid/usbhid/Makefile b/drivers/hid/usbhid/Makefile
index dd3b8634800f..5c460fcdd75c 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_ZEROPLUS_FF),y)
17 usbhid-objs += hid-zpff.o
18endif
19ifeq ($(CONFIG_HID_FF),y) 16ifeq ($(CONFIG_HID_FF),y)
20 usbhid-objs += hid-ff.o 17 usbhid-objs += hid-ff.o
21endif 18endif
diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c
index ed3a869d54e3..eca01a6fda59 100644
--- a/drivers/hid/usbhid/hid-ff.c
+++ b/drivers/hid/usbhid/hid-ff.c
@@ -50,10 +50,6 @@ struct hid_ff_initializer {
50 * be a PID device 50 * be a PID device
51 */ 51 */
52static struct hid_ff_initializer inits[] = { 52static struct hid_ff_initializer inits[] = {
53#ifdef CONFIG_ZEROPLUS_FF
54 { 0xc12, 0x0005, hid_zpff_init },
55 { 0xc12, 0x0030, hid_zpff_init },
56#endif
57 { 0, 0, hid_pidff_init} /* Matches anything */ 53 { 0, 0, hid_pidff_init} /* Matches anything */
58}; 54};
59 55
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 8266e50637b4..0773ba6a66f2 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -760,7 +760,6 @@ void usbhid_set_leds(struct hid_device *hid);
760#ifdef CONFIG_HID_FF 760#ifdef CONFIG_HID_FF
761int hid_ff_init(struct hid_device *hid); 761int hid_ff_init(struct hid_device *hid);
762 762
763int hid_zpff_init(struct hid_device *hid);
764#ifdef CONFIG_HID_PID 763#ifdef CONFIG_HID_PID
765int hid_pidff_init(struct hid_device *hid); 764int hid_pidff_init(struct hid_device *hid);
766#else 765#else