diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-09-18 13:43:32 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-10-14 17:51:00 -0400 |
commit | 5f022298aab58ddff9bccdb28b82a59109789da9 (patch) | |
tree | 08d87903b7a15c465a0b21cb7bdb7a30e9226cf3 /drivers/hid | |
parent | 2b107d629dc0c35de606bb7b010b829cd247a93a (diff) |
HID: move pantherlord FF processing
Move the force feedback processing into a separate module.
[jkosina@suse.cz: fix Kconfig texts a little bit]
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/Kconfig | 16 | ||||
-rw-r--r-- | drivers/hid/Makefile | 1 | ||||
-rw-r--r-- | drivers/hid/hid-core.c | 2 | ||||
-rw-r--r-- | drivers/hid/hid-dummy.c | 3 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 2 | ||||
-rw-r--r-- | drivers/hid/hid-pl.c (renamed from drivers/hid/usbhid/hid-plff.c) | 72 | ||||
-rw-r--r-- | drivers/hid/usbhid/Kconfig | 8 | ||||
-rw-r--r-- | drivers/hid/usbhid/Makefile | 3 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-ff.c | 4 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 1 |
10 files changed, 93 insertions, 19 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 46337a28d1d6..c836caba82d6 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -199,6 +199,22 @@ config HID_MONTEREY | |||
199 | ---help--- | 199 | ---help--- |
200 | Support for Monterey Genius KB29E. | 200 | Support for Monterey Genius KB29E. |
201 | 201 | ||
202 | config HID_PANTHERLORD | ||
203 | tristate "Pantherlord devices support" | ||
204 | default m | ||
205 | depends on USB_HID | ||
206 | ---help--- | ||
207 | Support for PantherLord/GreenAsia based device support. | ||
208 | |||
209 | |||
210 | config PANTHERLORD_FF | ||
211 | bool "Pantherlord force feedback support" | ||
212 | depends on HID_PANTHERLORD | ||
213 | select INPUT_FF_MEMLESS | ||
214 | help | ||
215 | Say Y here if you have a PantherLord/GreenAsia based game controller | ||
216 | or adapter and want to enable force feedback support for it. | ||
217 | |||
202 | config HID_PETALYNX | 218 | config HID_PETALYNX |
203 | tristate "Petalynx" | 219 | tristate "Petalynx" |
204 | default m | 220 | default m |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 300ee00913bc..e60706835243 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -32,6 +32,7 @@ obj-$(CONFIG_HID_GYRATION) += hid-gyration.o | |||
32 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o | 32 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o |
33 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o | 33 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o |
34 | obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o | 34 | obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o |
35 | obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o | ||
35 | obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o | 36 | obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o |
36 | obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o | 37 | obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o |
37 | obj-$(CONFIG_HID_SONY) += hid-sony.o | 38 | obj-$(CONFIG_HID_SONY) += hid-sony.o |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 63c8ce5540fe..48a76e791e02 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1411,6 +1411,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1411 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, | 1411 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, |
1412 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, | 1412 | { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, |
1413 | { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, | 1413 | { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, |
1414 | { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) }, | ||
1414 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) }, | 1415 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) }, |
1415 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) }, | 1416 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) }, |
1416 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) }, | 1417 | { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) }, |
@@ -1426,6 +1427,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1426 | { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2) }, | 1427 | { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2) }, |
1427 | { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN) }, | 1428 | { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN) }, |
1428 | { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER) }, | 1429 | { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER) }, |
1430 | { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003) }, | ||
1429 | { HID_USB_DEVICE(USB_VENDOR_ID_GRETAGMACBETH, USB_DEVICE_ID_GRETAGMACBETH_HUEY) }, | 1431 | { HID_USB_DEVICE(USB_VENDOR_ID_GRETAGMACBETH, USB_DEVICE_ID_GRETAGMACBETH_HUEY) }, |
1430 | { HID_USB_DEVICE(USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE) }, | 1432 | { HID_USB_DEVICE(USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE) }, |
1431 | { HID_USB_DEVICE(USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB) }, | 1433 | { HID_USB_DEVICE(USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB) }, |
diff --git a/drivers/hid/hid-dummy.c b/drivers/hid/hid-dummy.c index 69dcf9b1a444..2f5d9a1a352c 100644 --- a/drivers/hid/hid-dummy.c +++ b/drivers/hid/hid-dummy.c | |||
@@ -40,6 +40,9 @@ static int __init hid_dummy_init(void) | |||
40 | #ifdef CONFIG_HID_MONTEREY_MODULE | 40 | #ifdef CONFIG_HID_MONTEREY_MODULE |
41 | HID_COMPAT_CALL_DRIVER(monterey); | 41 | HID_COMPAT_CALL_DRIVER(monterey); |
42 | #endif | 42 | #endif |
43 | #ifdef CONFIG_HID_PANTHERLORD_MODULE | ||
44 | HID_COMPAT_CALL_DRIVER(pantherlord); | ||
45 | #endif | ||
43 | #ifdef CONFIG_HID_PETALYNX_MODULE | 46 | #ifdef CONFIG_HID_PETALYNX_MODULE |
44 | HID_COMPAT_CALL_DRIVER(petalynx); | 47 | HID_COMPAT_CALL_DRIVER(petalynx); |
45 | #endif | 48 | #endif |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index fa4e4fd96f65..fdd2d13036f7 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -169,6 +169,8 @@ | |||
169 | #define USB_DEVICE_ID_GOGOPEN 0x00ce | 169 | #define USB_DEVICE_ID_GOGOPEN 0x00ce |
170 | #define USB_DEVICE_ID_PENPOWER 0x00f4 | 170 | #define USB_DEVICE_ID_PENPOWER 0x00f4 |
171 | 171 | ||
172 | #define USB_VENDOR_ID_GREENASIA 0x0e8f | ||
173 | |||
172 | #define USB_VENDOR_ID_GRETAGMACBETH 0x0971 | 174 | #define USB_VENDOR_ID_GRETAGMACBETH 0x0971 |
173 | #define USB_DEVICE_ID_GRETAGMACBETH_HUEY 0x2005 | 175 | #define USB_DEVICE_ID_GRETAGMACBETH_HUEY 0x2005 |
174 | 176 | ||
diff --git a/drivers/hid/usbhid/hid-plff.c b/drivers/hid/hid-pl.c index 9eb83cf9d22b..a1d1fb9da125 100644 --- a/drivers/hid/usbhid/hid-plff.c +++ b/drivers/hid/hid-pl.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * - contains two reports, one for each port (HID_QUIRK_MULTI_INPUT) | 9 | * - contains two reports, one for each port (HID_QUIRK_MULTI_INPUT) |
10 | * | 10 | * |
11 | * 0e8f:0003 "GreenAsia Inc. USB Joystick " | 11 | * 0e8f:0003 "GreenAsia Inc. USB Joystick " |
12 | * - tested with Kรถng Gaming gamepad | 12 | * - tested with K??ng Gaming gamepad |
13 | * | 13 | * |
14 | * Copyright (c) 2007 Anssi Hannula <anssi.hannula@gmail.com> | 14 | * Copyright (c) 2007 Anssi Hannula <anssi.hannula@gmail.com> |
15 | */ | 15 | */ |
@@ -38,7 +38,11 @@ | |||
38 | #include <linux/input.h> | 38 | #include <linux/input.h> |
39 | #include <linux/usb.h> | 39 | #include <linux/usb.h> |
40 | #include <linux/hid.h> | 40 | #include <linux/hid.h> |
41 | #include "usbhid.h" | 41 | |
42 | #include "hid-ids.h" | ||
43 | |||
44 | #ifdef CONFIG_PANTHERLORD_FF | ||
45 | #include "usbhid/usbhid.h" | ||
42 | 46 | ||
43 | struct plff_device { | 47 | struct plff_device { |
44 | struct hid_report *report; | 48 | struct hid_report *report; |
@@ -66,7 +70,7 @@ static int hid_plff_play(struct input_dev *dev, void *data, | |||
66 | return 0; | 70 | return 0; |
67 | } | 71 | } |
68 | 72 | ||
69 | int hid_plff_init(struct hid_device *hid) | 73 | static int plff_init(struct hid_device *hid) |
70 | { | 74 | { |
71 | struct plff_device *plff; | 75 | struct plff_device *plff; |
72 | struct hid_report *report; | 76 | struct hid_report *report; |
@@ -137,3 +141,65 @@ int hid_plff_init(struct hid_device *hid) | |||
137 | 141 | ||
138 | return 0; | 142 | return 0; |
139 | } | 143 | } |
144 | #else | ||
145 | static inline int plff_init(struct hid_device *hid) | ||
146 | { | ||
147 | return 0; | ||
148 | } | ||
149 | #endif | ||
150 | |||
151 | static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id) | ||
152 | { | ||
153 | int ret; | ||
154 | |||
155 | if (id->driver_data) | ||
156 | hdev->quirks |= HID_QUIRK_MULTI_INPUT; | ||
157 | |||
158 | ret = hid_parse(hdev); | ||
159 | if (ret) { | ||
160 | dev_err(&hdev->dev, "parse failed\n"); | ||
161 | goto err; | ||
162 | } | ||
163 | |||
164 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | ||
165 | if (ret) { | ||
166 | dev_err(&hdev->dev, "hw start failed\n"); | ||
167 | goto err; | ||
168 | } | ||
169 | |||
170 | plff_init(hdev); | ||
171 | |||
172 | return 0; | ||
173 | err: | ||
174 | return ret; | ||
175 | } | ||
176 | |||
177 | static const struct hid_device_id pl_devices[] = { | ||
178 | { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR), | ||
179 | .driver_data = 1 }, /* Twin USB Joystick */ | ||
180 | { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003), }, /* GreenAsia Inc. USB Joystick */ | ||
181 | { } | ||
182 | }; | ||
183 | MODULE_DEVICE_TABLE(hid, pl_devices); | ||
184 | |||
185 | static struct hid_driver pl_driver = { | ||
186 | .name = "pantherlord", | ||
187 | .id_table = pl_devices, | ||
188 | .probe = pl_probe, | ||
189 | }; | ||
190 | |||
191 | static int pl_init(void) | ||
192 | { | ||
193 | return hid_register_driver(&pl_driver); | ||
194 | } | ||
195 | |||
196 | static void pl_exit(void) | ||
197 | { | ||
198 | hid_unregister_driver(&pl_driver); | ||
199 | } | ||
200 | |||
201 | module_init(pl_init); | ||
202 | module_exit(pl_exit); | ||
203 | MODULE_LICENSE("GPL"); | ||
204 | |||
205 | HID_COMPAT_LOAD_DRIVER(pantherlord); | ||
diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig index 0e7e2e6d975e..02c8228ed7ee 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 | ||
47 | config PANTHERLORD_FF | ||
48 | bool "PantherLord/GreenAsia based device support" | ||
49 | depends on HID_FF | ||
50 | select INPUT_FF_MEMLESS if USB_HID | ||
51 | help | ||
52 | Say Y here if you have a PantherLord/GreenAsia based game controller | ||
53 | or adapter and want to enable force feedback support for it. | ||
54 | |||
55 | config THRUSTMASTER_FF | 47 | config THRUSTMASTER_FF |
56 | bool "ThrustMaster devices support" | 48 | bool "ThrustMaster devices support" |
57 | depends on HID_FF | 49 | depends on HID_FF |
diff --git a/drivers/hid/usbhid/Makefile b/drivers/hid/usbhid/Makefile index 224c62dc6a32..0ee4803375b2 100644 --- a/drivers/hid/usbhid/Makefile +++ b/drivers/hid/usbhid/Makefile | |||
@@ -13,9 +13,6 @@ endif | |||
13 | ifeq ($(CONFIG_HID_PID),y) | 13 | ifeq ($(CONFIG_HID_PID),y) |
14 | usbhid-objs += hid-pidff.o | 14 | usbhid-objs += hid-pidff.o |
15 | endif | 15 | endif |
16 | ifeq ($(CONFIG_PANTHERLORD_FF),y) | ||
17 | usbhid-objs += hid-plff.o | ||
18 | endif | ||
19 | ifeq ($(CONFIG_THRUSTMASTER_FF),y) | 16 | ifeq ($(CONFIG_THRUSTMASTER_FF),y) |
20 | usbhid-objs += hid-tmff.o | 17 | usbhid-objs += hid-tmff.o |
21 | endif | 18 | endif |
diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c index 8891f60d3beb..a868eef06189 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 | */ |
52 | static struct hid_ff_initializer inits[] = { | 52 | static struct hid_ff_initializer inits[] = { |
53 | #ifdef CONFIG_PANTHERLORD_FF | ||
54 | { 0x810, 0x0001, hid_plff_init }, /* "Twin USB Joystick" */ | ||
55 | { 0xe8f, 0x0003, hid_plff_init }, /* "GreenAsia Inc. USB Joystick " */ | ||
56 | #endif | ||
57 | #ifdef CONFIG_THRUSTMASTER_FF | 53 | #ifdef CONFIG_THRUSTMASTER_FF |
58 | { 0x44f, 0xb300, hid_tmff_init }, | 54 | { 0x44f, 0xb300, hid_tmff_init }, |
59 | { 0x44f, 0xb304, hid_tmff_init }, | 55 | { 0x44f, 0xb304, hid_tmff_init }, |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index d40f00904c5e..47ebe045f9b5 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -32,7 +32,6 @@ static const struct hid_blacklist { | |||
32 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD }, | 32 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD }, |
33 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, | 33 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, |
34 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, | 34 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, |
35 | { USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR, HID_QUIRK_MULTI_INPUT }, | ||
36 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 35 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
37 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 36 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
38 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 37 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |