Skip to contentSkip to conversation

HID: move pantherlord FF processing

PATCH In review Jiri Slaby 2 participants 7 messages Sep 4, 2008 – Sep 18, 2008

Subsystems (2)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/5 HID: move pantherlord FF processing

Move the force feedback precessing into a separate module.

---
 drivers/hid/Kconfig             |   16 +++
 drivers/hid/Makefile            |    1 +
 drivers/hid/hid-core.c          |    2 +
 drivers/hid/hid-dummy.c         |    3 +
 drivers/hid/hid-ids.h           |    2 +
 drivers/hid/hid-pl.c            |  205 +++++++++++++++++++++++++++++++++++++++
 drivers/hid/usbhid/Kconfig      |    8 --
 drivers/hid/usbhid/Makefile     |    3 -
 drivers/hid/usbhid/hid-ff.c     |    4 -
 drivers/hid/usbhid/hid-plff.c   |  139 --------------------------
 drivers/hid/usbhid/hid-quirks.c |    1 -
 include/linux/hid.h             |    1 -
 12 files changed, 229 insertions(+), 156 deletions(-)
 create mode 100644 drivers/hid/hid-pl.c
 delete mode 100644 drivers/hid/usbhid/hid-plff.c
drivers/hid/Kconfig +16 -0
index 46337a2..7220e6f 100644
@@ -199,6 +199,22 @@ config HID_MONTEREY
 	---help---
 	Support for Monterey Genius KB29E.
 
+config HID_PANTHERLORD
+	tristate "Pantherlord"
+	default m
+	depends on USB_HID
+	---help---
+	Support for PantherLord/GreenAsia based device support (including
+	force feedback).
+
+config PANTHERLORD_FF
+	bool "Force feedback support"
+	depends on HID_PANTHERLORD
+	select INPUT_FF_MEMLESS
+	help
+	  Say Y here if you have a PantherLord/GreenAsia based game controller
+	  or adapter and want to enable force feedback support for it.
+
 config HID_PETALYNX
 	tristate "Petalynx"
 	default m
drivers/hid/Makefile +1 -0
index 300ee00..e607068 100644
@@ -32,6 +32,7 @@ obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
 obj-$(CONFIG_HID_LOGITECH)	+= hid-logitech.o
 obj-$(CONFIG_HID_MICROSOFT)	+= hid-microsoft.o
 obj-$(CONFIG_HID_MONTEREY)	+= hid-monterey.o
+obj-$(CONFIG_HID_PANTHERLORD)	+= hid-pl.o
 obj-$(CONFIG_HID_PETALYNX)	+= hid-petalynx.o
 obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
 obj-$(CONFIG_HID_SONY)		+= hid-sony.o
drivers/hid/hid-core.c +2 -0
index 798bb0a..3a12bb6 100644
@@ -1411,6 +1411,7 @@ static const struct hid_device_id hid_ignore_list[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) },
@@ -1426,6 +1427,7 @@ static const struct hid_device_id hid_ignore_list[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GRETAGMACBETH, USB_DEVICE_ID_GRETAGMACBETH_HUEY) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB) },
drivers/hid/hid-dummy.c +3 -0
index 69dcf9b..2f5d9a1 100644
@@ -40,6 +40,9 @@ static int __init hid_dummy_init(void)
 #ifdef CONFIG_HID_MONTEREY_MODULE
 	HID_COMPAT_CALL_DRIVER(monterey);
 #endif
+#ifdef CONFIG_HID_PANTHERLORD_MODULE
+	HID_COMPAT_CALL_DRIVER(pantherlord);
+#endif
 #ifdef CONFIG_HID_PETALYNX_MODULE
 	HID_COMPAT_CALL_DRIVER(petalynx);
 #endif
drivers/hid/hid-ids.h +2 -0
index 0784a09..a4d9695 100644
@@ -373,6 +373,8 @@
 #define USB_DEVICE_ID_QUAD_USB_JOYPAD	0x8800
 #define USB_DEVICE_ID_DUAL_USB_JOYPAD	0x8866
 
+#define USB_VENDOR_ID_GREENASIA		0x0e8f
+
 #define USB_VENDOR_ID_WISEGROUP_LTD	0x6666
 #define USB_VENDOR_ID_WISEGROUP_LTD2	0x6677
 #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802
drivers/hid/hid-pl.c new file +205 -0

205 lines not on this page · raw message

drivers/hid/usbhid/Kconfig +0 -8
index 0e7e2e6..02c8228 100644
@@ -44,14 +44,6 @@ config HID_PID
 	  feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
 	  devices.
 
-config PANTHERLORD_FF
-	bool "PantherLord/GreenAsia based device support"
-	depends on HID_FF
-	select INPUT_FF_MEMLESS if USB_HID
-	help
-	  Say Y here if you have a PantherLord/GreenAsia based game controller
-	  or adapter and want to enable force feedback support for it.
-
 config THRUSTMASTER_FF
 	bool "ThrustMaster devices support"
 	depends on HID_FF
drivers/hid/usbhid/Makefile +0 -3
index 224c62d..0ee4803 100644
@@ -13,9 +13,6 @@ endif
 ifeq ($(CONFIG_HID_PID),y)
 	usbhid-objs	+= hid-pidff.o
 endif
-ifeq ($(CONFIG_PANTHERLORD_FF),y)
-	usbhid-objs	+= hid-plff.o
-endif
 ifeq ($(CONFIG_THRUSTMASTER_FF),y)
 	usbhid-objs	+= hid-tmff.o
 endif
drivers/hid/usbhid/hid-ff.c +0 -4
index 8891f60..a868eef 100644
@@ -50,10 +50,6 @@ struct hid_ff_initializer {
  * be a PID device
  */
 static struct hid_ff_initializer inits[] = {
-#ifdef CONFIG_PANTHERLORD_FF
-	{ 0x810, 0x0001, hid_plff_init }, /* "Twin USB Joystick" */
-	{ 0xe8f, 0x0003, hid_plff_init }, /* "GreenAsia Inc.    USB Joystick     " */
-#endif
 #ifdef CONFIG_THRUSTMASTER_FF
 	{ 0x44f, 0xb300, hid_tmff_init },
 	{ 0x44f, 0xb304, hid_tmff_init },
drivers/hid/usbhid/hid-plff.c deleted +0 -139

139 lines not on this page · raw message

drivers/hid/usbhid/hid-quirks.c +0 -1
index d40f009..47ebe04 100644
@@ -32,7 +32,6 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
-	{ USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
include/linux/hid.h +0 -1
index 164ce7f..260beba 100644
@@ -760,7 +760,6 @@ void usbhid_set_leds(struct hid_device *hid);
 #ifdef CONFIG_HID_FF
 int hid_ff_init(struct hid_device *hid);
 
-int hid_plff_init(struct hid_device *hid);
 int hid_tmff_init(struct hid_device *hid);
 int hid_zpff_init(struct hid_device *hid);
 #ifdef CONFIG_HID_PID
Signature · 6 lines
1.6.0

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#1 lore raw

PATCH 2/5 HID: move thrustmaster FF processing

---
 drivers/hid/Kconfig           |    9 ++
 drivers/hid/Makefile          |    1 +
 drivers/hid/hid-core.c        |    4 +
 drivers/hid/hid-dummy.c       |    3 +
 drivers/hid/hid-ids.h         |    2 +
 drivers/hid/hid-tmff.c        |  265 +++++++++++++++++++++++++++++++++++++++++
 drivers/hid/usbhid/Kconfig    |   11 --
 drivers/hid/usbhid/Makefile   |    3 -
 drivers/hid/usbhid/hid-ff.c   |    6 -
 drivers/hid/usbhid/hid-tmff.c |  232 ------------------------------------
 include/linux/hid.h           |    1 -
 11 files changed, 284 insertions(+), 253 deletions(-)
 create mode 100644 drivers/hid/hid-tmff.c
 delete mode 100644 drivers/hid/usbhid/hid-tmff.c
drivers/hid/Kconfig +9 -0
index 7220e6f..268fcd1 100644
@@ -243,6 +243,15 @@ config HID_SUNPLUS
 	---help---
 	Support for Sunplus WDesktop input device.
 
+config THRUSTMASTER_FF
+	tristate "ThrustMaster devices support"
+	default m
+	depends on USB_HID
+	select INPUT_FF_MEMLESS
+	help
+	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
+	  a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel.
+
 endmenu
 
 endif # HID_SUPPORT
drivers/hid/Makefile +1 -0
index e607068..9bd6daf 100644
@@ -37,6 +37,7 @@ obj-$(CONFIG_HID_PETALYNX)	+= hid-petalynx.o
 obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
 obj-$(CONFIG_HID_SONY)		+= hid-sony.o
 obj-$(CONFIG_HID_SUNPLUS)	+= hid-sunplus.o
+obj-$(CONFIG_THRUSTMASTER_FF)	+= hid-tmff.o
 
 obj-$(CONFIG_USB_HID)		+= usbhid/
 obj-$(CONFIG_USB_MOUSE)		+= usbhid/
drivers/hid/hid-core.c +4 -0
index 3a12bb6..e6624d9 100644
@@ -1514,6 +1514,10 @@ static const struct hid_device_id hid_ignore_list[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0003) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
drivers/hid/hid-dummy.c +3 -0
index 2f5d9a1..ae122a1 100644
@@ -55,6 +55,9 @@ static int __init hid_dummy_init(void)
 #ifdef CONFIG_HID_SUNPLUS_MODULE
 	HID_COMPAT_CALL_DRIVER(sunplus);
 #endif
+#ifdef CONFIG_THRUSTMASTER_FF_MODULE
+	HID_COMPAT_CALL_DRIVER(thrustmaster);
+#endif
 
 	return -EIO;
 }
drivers/hid/hid-ids.h +2 -0
index a4d9695..30dcc93 100644
@@ -348,6 +348,8 @@
 #define USB_VENDOR_ID_SUN		0x0430
 #define USB_DEVICE_ID_RARITAN_KVM_DONGLE	0xcdab
 
+#define USB_VENDOR_ID_THRUSTMASTER	0x044f
+
 #define USB_VENDOR_ID_SUNPLUS		0x04fc
 #define USB_DEVICE_ID_SUNPLUS_WDESKTOP	0x05d8
 
drivers/hid/hid-tmff.c new file +265 -0

265 lines not on this page · raw message

drivers/hid/usbhid/Kconfig +0 -11
index 02c8228..c236fb3 100644
@@ -44,17 +44,6 @@ config HID_PID
 	  feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
 	  devices.
 
-config THRUSTMASTER_FF
-	bool "ThrustMaster devices support"
-	depends on HID_FF
-	select INPUT_FF_MEMLESS if USB_HID
-	help
-	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
-	  a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel,
-	  and want to enable force feedback support for it.
-	  Note: if you say N here, this device will still be supported, but without
-	  force feedback.
-
 config ZEROPLUS_FF
 	bool "Zeroplus based game controller support"
 	depends on HID_FF
drivers/hid/usbhid/Makefile +0 -3
index 0ee4803..dd3b863 100644
@@ -13,9 +13,6 @@ endif
 ifeq ($(CONFIG_HID_PID),y)
 	usbhid-objs	+= hid-pidff.o
 endif
-ifeq ($(CONFIG_THRUSTMASTER_FF),y)
-	usbhid-objs	+= hid-tmff.o
-endif
 ifeq ($(CONFIG_ZEROPLUS_FF),y)
 	usbhid-objs	+= hid-zpff.o
 endif
drivers/hid/usbhid/hid-ff.c +0 -6
index a868eef..ed3a869 100644
@@ -50,12 +50,6 @@ struct hid_ff_initializer {
  * be a PID device
  */
 static struct hid_ff_initializer inits[] = {
-#ifdef CONFIG_THRUSTMASTER_FF
-	{ 0x44f, 0xb300, hid_tmff_init },
-	{ 0x44f, 0xb304, hid_tmff_init },
-	{ 0x44f, 0xb651, hid_tmff_init }, /* FGT Rumble Force Wheel */
-	{ 0x44f, 0xb654, hid_tmff_init }, /* FGT Force Feedback Wheel */
-#endif
 #ifdef CONFIG_ZEROPLUS_FF
 	{ 0xc12, 0x0005, hid_zpff_init },
 	{ 0xc12, 0x0030, hid_zpff_init },
drivers/hid/usbhid/hid-tmff.c deleted +0 -232

232 lines not on this page · raw message

include/linux/hid.h +0 -1
index 260beba..2af65a7 100644
@@ -760,7 +760,6 @@ void usbhid_set_leds(struct hid_device *hid);
 #ifdef CONFIG_HID_FF
 int hid_ff_init(struct hid_device *hid);
 
-int hid_tmff_init(struct hid_device *hid);
 int hid_zpff_init(struct hid_device *hid);
 #ifdef CONFIG_HID_PID
 int hid_pidff_init(struct hid_device *hid);
Signature · 1 line
1.6.0
author
#2 lore raw

PATCH 3/5 HID: move zeroplus FF processing

---
 drivers/hid/Kconfig           |    8 ++
 drivers/hid/Makefile          |    1 +
 drivers/hid/hid-core.c        |    2 +
 drivers/hid/hid-dummy.c       |    3 +
 drivers/hid/hid-ids.h         |    2 +
 drivers/hid/hid-zpff.c        |  162 +++++++++++++++++++++++++++++++++++++++++
 drivers/hid/usbhid/Kconfig    |    8 --
 drivers/hid/usbhid/Makefile   |    3 -
 drivers/hid/usbhid/hid-ff.c   |    4 -
 drivers/hid/usbhid/hid-zpff.c |  107 ---------------------------
 include/linux/hid.h           |    1 -
 11 files changed, 178 insertions(+), 123 deletions(-)
 create mode 100644 drivers/hid/hid-zpff.c
 delete mode 100644 drivers/hid/usbhid/hid-zpff.c
drivers/hid/Kconfig +8 -0
index 268fcd1..e4d5263 100644
@@ -252,6 +252,14 @@ config THRUSTMASTER_FF
 	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
 	  a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel.
 
+config ZEROPLUS_FF
+	tristate "Zeroplus based game controller support"
+	default m
+	depends on USB_HID
+	select INPUT_FF_MEMLESS
+	help
+	  Say Y here if you have a Zeroplus based game controller.
+
 endmenu
 
 endif # HID_SUPPORT
drivers/hid/Makefile +1 -0
index 9bd6daf..767f295 100644
@@ -38,6 +38,7 @@ obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
 obj-$(CONFIG_HID_SONY)		+= hid-sony.o
 obj-$(CONFIG_HID_SUNPLUS)	+= hid-sunplus.o
 obj-$(CONFIG_THRUSTMASTER_FF)	+= hid-tmff.o
+obj-$(CONFIG_ZEROPLUS_FF)	+= hid-zpff.o
 
 obj-$(CONFIG_USB_HID)		+= usbhid/
 obj-$(CONFIG_USB_MOUSE)		+= usbhid/
drivers/hid/hid-core.c +2 -0
index e6624d9..92c16e1 100644
@@ -1528,6 +1528,8 @@ static const struct hid_device_id hid_ignore_list[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
 	{ }
 };
 
drivers/hid/hid-dummy.c +3 -0
index ae122a1..54d1fb6 100644
@@ -58,6 +58,9 @@ static int __init hid_dummy_init(void)
 #ifdef CONFIG_THRUSTMASTER_FF_MODULE
 	HID_COMPAT_CALL_DRIVER(thrustmaster);
 #endif
+#ifdef CONFIG_ZEROPLUS_FF_MODULE
+	HID_COMPAT_CALL_DRIVER(zeroplus);
+#endif
 
 	return -EIO;
 }
drivers/hid/hid-ids.h +2 -0
index 30dcc93..11b0720 100644
@@ -375,6 +375,8 @@
 #define USB_DEVICE_ID_QUAD_USB_JOYPAD	0x8800
 #define USB_DEVICE_ID_DUAL_USB_JOYPAD	0x8866
 
+#define USB_VENDOR_ID_ZEROPLUS		0x0c12
+
 #define USB_VENDOR_ID_GREENASIA		0x0e8f
 
 #define USB_VENDOR_ID_WISEGROUP_LTD	0x6666
drivers/hid/hid-zpff.c new file +162 -0

162 lines not on this page · raw message

drivers/hid/usbhid/Kconfig +0 -8
index c236fb3..3cfc076 100644
@@ -44,14 +44,6 @@ config HID_PID
 	  feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
 	  devices.
 
-config ZEROPLUS_FF
-	bool "Zeroplus based game controller support"
-	depends on HID_FF
-	select INPUT_FF_MEMLESS if USB_HID
-	help
-	  Say Y here if you have a Zeroplus based game controller and want to
-	  enable force feedback for it.
-
 config USB_HIDDEV
 	bool "/dev/hiddev raw HID device support"
 	depends on USB_HID
drivers/hid/usbhid/Makefile +0 -3
index dd3b863..5c460fc 100644
@@ -13,9 +13,6 @@ endif
 ifeq ($(CONFIG_HID_PID),y)
 	usbhid-objs	+= hid-pidff.o
 endif
-ifeq ($(CONFIG_ZEROPLUS_FF),y)
-	usbhid-objs	+= hid-zpff.o
-endif
 ifeq ($(CONFIG_HID_FF),y)
 	usbhid-objs	+= hid-ff.o
 endif
drivers/hid/usbhid/hid-ff.c +0 -4
index ed3a869..eca01a6 100644
@@ -50,10 +50,6 @@ struct hid_ff_initializer {
  * be a PID device
  */
 static struct hid_ff_initializer inits[] = {
-#ifdef CONFIG_ZEROPLUS_FF
-	{ 0xc12, 0x0005, hid_zpff_init },
-	{ 0xc12, 0x0030, hid_zpff_init },
-#endif
 	{ 0,	 0,	 hid_pidff_init}  /* Matches anything */
 };
 
drivers/hid/usbhid/hid-zpff.c deleted +0 -107

107 lines not on this page · raw message

include/linux/hid.h +0 -1
index 2af65a7..6cf0357 100644
@@ -760,7 +760,6 @@ void usbhid_set_leds(struct hid_device *hid);
 #ifdef CONFIG_HID_FF
 int hid_ff_init(struct hid_device *hid);
 
-int hid_zpff_init(struct hid_device *hid);
 #ifdef CONFIG_HID_PID
 int hid_pidff_init(struct hid_device *hid);
 #else
Signature · 1 line
1.6.0
author
#3 lore raw

PATCH 4/5 HID: remove hid-ff

hid-ff.c now calls only pidff (generic driver), the special ones are now in separate drivers. Invoke pidff on all non-special directly.

---
 drivers/hid/usbhid/Kconfig    |   13 --------
 drivers/hid/usbhid/Makefile   |    3 --
 drivers/hid/usbhid/hid-core.c |    2 +-
 drivers/hid/usbhid/hid-ff.c   |   69 -----------------------------------------
 include/linux/hid.h           |    9 +-----
 5 files changed, 2 insertions(+), 94 deletions(-)
 delete mode 100644 drivers/hid/usbhid/hid-ff.c
drivers/hid/usbhid/Kconfig +0 -13
index 3cfc076..5d9aa95 100644
@@ -24,21 +24,8 @@ config USB_HID
 comment "Input core support is needed for USB HID input layer or HIDBP support"
 	depends on USB_HID && INPUT=n
 
-config HID_FF
-	bool "Force feedback support (EXPERIMENTAL)"
-	depends on USB_HID && EXPERIMENTAL
-	help
-	  Say Y here is you want force feedback support for a few HID devices.
-	  See below for a list of supported devices.
-
-	  See <file:Documentation/input/ff.txt> for a description of the force
-	  feedback API.
-
-	  If unsure, say N.
-
 config HID_PID
 	bool "PID device support"
-	depends on HID_FF
 	help
 	  Say Y here if you have a PID-compliant device and wish to enable force
 	  feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
drivers/hid/usbhid/Makefile +0 -3
index 5c460fc..1329ecb 100644
@@ -13,9 +13,6 @@ endif
 ifeq ($(CONFIG_HID_PID),y)
 	usbhid-objs	+= hid-pidff.o
 endif
-ifeq ($(CONFIG_HID_FF),y)
-	usbhid-objs	+= hid-ff.o
-endif
 
 obj-$(CONFIG_USB_HID)		+= usbhid.o
 obj-$(CONFIG_USB_KBD)		+= usbkbd.o
drivers/hid/usbhid/hid-core.c +1 -1
index 5f32e30..d448e4d 100644
@@ -938,7 +938,7 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	usb_set_intfdata(intf, hid);
 	hid->ll_driver = &usb_hid_driver;
 	hid->hid_output_raw_report = usbhid_output_raw_report;
-	hid->ff_init = hid_ff_init;
+	hid->ff_init = hid_pidff_init;
 #ifdef CONFIG_USB_HIDDEV
 	hid->hiddev_connect = hiddev_connect;
 	hid->hiddev_hid_event = hiddev_hid_event;
drivers/hid/usbhid/hid-ff.c deleted +0 -69

69 lines not on this page · raw message

include/linux/hid.h +1 -8
index 6cf0357..eb1844c 100644
@@ -757,17 +757,10 @@ int usbhid_quirks_init(char **quirks_param);
 void usbhid_quirks_exit(void);
 void usbhid_set_leds(struct hid_device *hid);
 
-#ifdef CONFIG_HID_FF
-int hid_ff_init(struct hid_device *hid);
-
 #ifdef CONFIG_HID_PID
 int hid_pidff_init(struct hid_device *hid);
 #else
-static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
-#endif
-
-#else
-#define hid_ff_init	NULL
+#define hid_pidff_init NULL
 #endif
 
 #ifdef CONFIG_HID_DEBUG
Signature · 1 line
1.6.0
author
#4 lore raw

PATCH 5/5 HID: convert to dev_* prints

Since we have a real device bound to a driver, we may use struct device for printing. Use dev_* functions instead of printks in 3 drivers.

---
 drivers/hid/hid-lg2ff.c |    8 ++++----
 drivers/hid/hid-pl.c    |   11 ++++++-----
 drivers/hid/hid-zpff.c  |    6 +++---
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/hid/hid-lg2ff.c +4 -4
index b2e9a67..4e6dc6e 100644
@@ -71,18 +71,18 @@ int lg2ff_init(struct hid_device *hid)
 	int error;
 
 	if (list_empty(report_list)) {
-		printk(KERN_ERR "hid-lg2ff: no output report found\n");
+		dev_err(&hid->dev, "no output report found\n");
 		return -ENODEV;
 	}
 
 	report = list_entry(report_list->next, struct hid_report, list);
 
 	if (report->maxfield < 1) {
-		printk(KERN_ERR "hid-lg2ff: output report is empty\n");
+		dev_err(&hid->dev, "output report is empty\n");
 		return -ENODEV;
 	}
 	if (report->field[0]->report_count < 7) {
-		printk(KERN_ERR "hid-lg2ff: not enough values in the field\n");
+		dev_err(&hid->dev, "not enough values in the field\n");
 		return -ENODEV;
 	}
 
@@ -109,7 +109,7 @@ int lg2ff_init(struct hid_device *hid)
 
 	usbhid_submit_report(hid, report, USB_DIR_OUT);
 
-	printk(KERN_INFO "Force feedback for Logitech Rumblepad 2 by "
+	dev_info(&hid->dev, "Force feedback for Logitech Rumblepad 2 by "
 	       "Anssi Hannula <[email protected]>\n");
 
 	return 0;
drivers/hid/hid-pl.c +6 -5
index b450084..682cac1 100644
@@ -90,7 +90,7 @@ static int plff_init(struct hid_device *hid)
 	   currently unknown. */
 
 	if (list_empty(report_list)) {
-		printk(KERN_ERR "hid-plff: no output reports found\n");
+		dev_err(&hid->dev, "no output reports found\n");
 		return -ENODEV;
 	}
 
@@ -99,18 +99,19 @@ static int plff_init(struct hid_device *hid)
 		report_ptr = report_ptr->next;
 
 		if (report_ptr == report_list) {
-			printk(KERN_ERR "hid-plff: required output report is missing\n");
+			dev_err(&hid->dev, "required output report is "
+					"missing\n");
 			return -ENODEV;
 		}
 
 		report = list_entry(report_ptr, struct hid_report, list);
 		if (report->maxfield < 1) {
-			printk(KERN_ERR "hid-plff: no fields in the report\n");
+			dev_err(&hid->dev, "no fields in the report\n");
 			return -ENODEV;
 		}
 
 		if (report->field[0]->report_count < 4) {
-			printk(KERN_ERR "hid-plff: not enough values in the field\n");
+			dev_err(&hid->dev, "not enough values in the field\n");
 			return -ENODEV;
 		}
 
@@ -136,7 +137,7 @@ static int plff_init(struct hid_device *hid)
 		usbhid_submit_report(hid, plff->report, USB_DIR_OUT);
 	}
 
-	printk(KERN_INFO "hid-plff: Force feedback for PantherLord/GreenAsia "
+	dev_info(&hid->dev, "Force feedback for PantherLord/GreenAsia "
 	       "devices by Anssi Hannula <[email protected]>\n");
 
 	return 0;
drivers/hid/hid-zpff.c +3 -3
index 9ed04ee..ea82f37 100644
@@ -73,14 +73,14 @@ static int zpff_init(struct hid_device *hid)
 	int error;
 
 	if (list_empty(report_list)) {
-		printk(KERN_ERR "hid-zpff: no output report found\n");
+		dev_err(&hid->dev, "no output report found\n");
 		return -ENODEV;
 	}
 
 	report = list_entry(report_list->next, struct hid_report, list);
 
 	if (report->maxfield < 4) {
-		printk(KERN_ERR "hid-zpff: not enough fields in report\n");
+		dev_err(&hid->dev, "not enough fields in report\n");
 		return -ENODEV;
 	}
 
@@ -103,7 +103,7 @@ static int zpff_init(struct hid_device *hid)
 	zpff->report->field[3]->value[0] = 0x00;
 	usbhid_submit_report(hid, zpff->report, USB_DIR_OUT);
 
-	printk(KERN_INFO "Force feedback for Zeroplus based devices by "
+	dev_info(&hid->dev, "force feedback for Zeroplus based devices by "
 	       "Anssi Hannula <[email protected]>\n");
 
 	return 0;
Signature · 1 line
1.6.0
#5 lore raw
In reply to Jiri Slaby
Quoted 9 lines · Jiri Slaby

Move the force feedback precessing into a separate module.

drivers/hid/hid-ids.h +0 -0
index 0784a09..a4d9695 100644

drivers/hid/hid-ids.h line 380

Quoted 8 lines
drivers/hid/hid-ids.h +2 -0
@@ -373,6 +373,8 @@
 #define USB_DEVICE_ID_QUAD_USB_JOYPAD	0x8800
 #define USB_DEVICE_ID_DUAL_USB_JOYPAD	0x8866
 
+#define USB_VENDOR_ID_GREENASIA		0x0e8f
+
 #define USB_VENDOR_ID_WISEGROUP_LTD	0x6666
 #define USB_VENDOR_ID_WISEGROUP_LTD2	0x6677
 #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802

Could we please preserve alphabetical ordering in hid-ids.h file?

Otherwise the series looks good to me, and Anssi didn't complain as well. Could you please rebase it on top of the current HID tree, fix the ordering, and send it to me again, I will apply it?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
author
#6 lore raw
Quoted 14 lines · Jiri Kosina
Quoted 12 lines · Jiri Slaby

Move the force feedback precessing into a separate module.

drivers/hid/hid-ids.h +0 -0
index 0784a09..a4d9695 100644
@@ -373,6 +373,8 @@
 #define USB_DEVICE_ID_QUAD_USB_JOYPAD	0x8800
 #define USB_DEVICE_ID_DUAL_USB_JOYPAD	0x8866
 
Quoted 7 lines

drivers/hid/hid-ids.h line 380

Quoted 5 lines
drivers/hid/hid-ids.h +2 -0
+#define USB_VENDOR_ID_GREENASIA		0x0e8f
+
 #define USB_VENDOR_ID_WISEGROUP_LTD	0x6666
 #define USB_VENDOR_ID_WISEGROUP_LTD2	0x6677
 #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802

Could we please preserve alphabetical ordering in hid-ids.h file?

Oops, sorry for that, I tried to sort it numerically not noticing it's sorted alphabetically.

Quoted 3 lines

Otherwise the series looks good to me, and Anssi didn't complain as well. Could you please rebase it on top of the current HID tree, fix the ordering, and send it to me again, I will apply it?

No problem.

Thanks.