Skip to contentSkip to conversation

usb/hid: The HID Simple Driver Patches 0.5.1 for 2.6.22 (all-in-one)

PATCH New raise.sail 1 participant 1 message Jul 16, 2007

Subsystems (2)
lore
Share & tools
lore

raise.sail

author
#0 lore raw

PATCH 1/1 usb/hid: The HID Simple Driver Patches 0.5.1 for 2.6.22 (all-in-one)

It hasn't any feature change, this release just is 2.6.22 port, enjoy it.

It can be apply at 2.6.22 vanilla at least.

include/linux/hid.h +12 -0
diff -Naurp linux-2.6.22-rc5/include/linux/hid.h linux-2.6.22-rc5.hid-simple.tree/include/linux/hid.h
@@ -35,6 +35,7 @@
 #include <linux/timer.h>
 #include <linux/workqueue.h>
 #include <linux/input.h>
+#include <linux/mutex.h>
 
 /*
  * USB HID (Human Interface Device) interface class code
@@ -406,8 +407,15 @@ struct hid_input {
 	struct list_head list;
 	struct hid_report *report;
 	struct input_dev *input;
+	unsigned long input_lock;	/* To protect accessing input_dev from
+					 * hid-input processing. But it not 
+					 * necessary for accessing this input_dev 
+					 * instance from input subsystem. */
+	void *private;
 };
 
+struct hidinput_simple_driver;
+
 struct hid_device {							/* device report descriptor */
 	 __u8 *rdesc;
 	unsigned rsize;
@@ -438,6 +446,8 @@ struct hid_device {							/* device repo
 	char phys[64];							/* Device physical location */
 	char uniq[64];							/* Device unique identifier (serial #) */
 
+	struct hidinput_simple_driver *simple;
+
 	void *driver_data;
 
 	/* device-specific function pointers */
@@ -492,6 +502,8 @@ extern void hidinput_hid_event(struct hi
 extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
 extern int hidinput_connect(struct hid_device *);
 extern void hidinput_disconnect(struct hid_device *);
+extern void hidinput_reconnect_core(struct hid_device *);
+extern int hidinput_disconnect_core(struct hid_device *);
 
 int hid_set_field(struct hid_field *, unsigned, __s32);
 int hid_input_report(struct hid_device *, int type, u8 *, int, int);
include/linux/hid-simple.h +262 -0

262 lines not on this page · raw message

drivers/hid/hid-core.c +151 -2

185 lines not on this page · raw message

drivers/hid/hid-input.c +157 -43

376 lines not on this page · raw message

drivers/hid/hid-simple.c +334 -0

334 lines not on this page · raw message

drivers/hid/Kconfig +8 -0
diff -Naurp linux-2.6.22-rc5/drivers/hid/Kconfig linux-2.6.22-rc5.hid-simple.tree/drivers/hid/Kconfig
@@ -38,5 +38,13 @@ config HID_DEBUG
 
 source "drivers/hid/usbhid/Kconfig"
 
+config HID_SIMPLE
+        bool "HID simple driver interface"
+        depends on HID
+        help
+          This simple interface let the writing HID driver more easier. Moreover,
+          this allow you write force-feedback driver without touch HID input
+          implementation code. Also, it can be used as input filter.
+
 endmenu
 
drivers/hid/Makefile +4 -0
diff -Naurp linux-2.6.22-rc5/drivers/hid/Makefile linux-2.6.22-rc5.hid-simple.tree/drivers/hid/Makefile
@@ -3,6 +3,10 @@
 #
 hid-objs			:= hid-core.o hid-input.o
 
+ifeq ($(CONFIG_HID_SIMPLE),y)
+hid-objs     += hid-simple.o
+endif
+
 obj-$(CONFIG_HID)		+= hid.o
 hid-$(CONFIG_HID_DEBUG)		+= hid-debug.o
 
drivers/hid/usbhid/hid-core.c +80 -3

123 lines not on this page · raw message

drivers/hid/usbhid/Kconfig +8 -0
diff -Naurp linux-2.6.22-rc5/drivers/hid/usbhid/Kconfig linux-2.6.22-rc5.hid-simple.tree/drivers/hid/usbhid/Kconfig
@@ -54,6 +54,14 @@ config HID_PID
 	  feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
 	  devices.
 
+config HID_SIMPLE_MSNEK4K
+	tristate "Microsoft Natural Ergonomic Keyboard 4000 Driver"
+	depends on HID_SIMPLE
+	---help---
+	  Microsoft Natural Ergonomic Keyboard 4000 extended keys support. These
+	  may not work without change user space configration, e.g, XKB conf-
+	  iguration in X.
+
 config LOGITECH_FF
 	bool "Logitech devices support"
 	depends on HID_FF
drivers/hid/usbhid/Makefile +1 -0
diff -Naurp linux-2.6.22-rc5/drivers/hid/usbhid/Makefile linux-2.6.22-rc5.hid-simple.tree/drivers/hid/usbhid/Makefile
@@ -29,6 +29,7 @@ ifeq ($(CONFIG_HID_FF),y)
 	usbhid-objs	+= hid-ff.o
 endif
 
+obj-$(CONFIG_HID_SIMPLE_MSNEK4K)	+= usbnek4k.o
 obj-$(CONFIG_USB_HID)		+= usbhid.o
 obj-$(CONFIG_USB_KBD)		+= usbkbd.o
 obj-$(CONFIG_USB_MOUSE)		+= usbmouse.o
drivers/hid/usbhid/usbnek4k.c +356 -0

356 lines not on this page · raw message