Skip to contentSkip to conversation

usb/hid:The HID Simple Driver Patches 0.5.0 (all-in-one)

PATCH New Li Yu 1 participant 1 message Mar 5, 2007

Subsystems (2)
lore
Share & tools
lore

Li Yu

author
#0 lore raw

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

This patch set include follow patches:

1. [PATCH] usb/hid: The HID Simple Driver Interface 0.5.0 (core)
2. [PATCH] usb/hid:Microsoft Natural Ergonomic Keyboard 4000 Driver 0.5.0
3. Some related kbuild changes.

The code base is 2.6.21-rc2

include/linux/hid.h +12 -0
diff -Naurp linux-2.6.21-rc2.orig/include/linux/hid.h linux-2.6.21-rc2/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
@@ -397,8 +398,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;
@@ -429,6 +437,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 */
@@ -483,6 +493,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 +260 -0

260 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 -42

370 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.21-rc2.orig/drivers/hid/Kconfig linux-2.6.21-rc2/drivers/hid/Kconfig
@@ -36,5 +36,13 @@ config HID_DEBUG
 
 	If unsure, say N
 
+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.21-rc2.orig/drivers/hid/Makefile linux-2.6.21-rc2/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/usb/input/hid-core.c +80 -3

124 lines not on this page · raw message

drivers/usb/input/Kconfig +9 -0
diff -Naurp linux-2.6.21-rc2.orig/drivers/usb/input/Kconfig linux-2.6.21-rc2/drivers/usb/input/Kconfig
@@ -357,6 +357,15 @@ config USB_APPLETOUCH
 	  To compile this driver as a module, choose M here: the
 	  module will be called appletouch.
 
+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 USB_GTCO
         tristate "GTCO CalComp/InterWrite USB Support"
         depends on USB && INPUT
drivers/usb/input/Makefile +1 -0
diff -Naurp linux-2.6.21-rc2.orig/drivers/usb/input/Makefile linux-2.6.21-rc2/drivers/usb/input/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_USB_ACECAD)	+= acecad.o
 obj-$(CONFIG_USB_YEALINK)	+= yealink.o
 obj-$(CONFIG_USB_XPAD)		+= xpad.o
 obj-$(CONFIG_USB_APPLETOUCH)	+= appletouch.o
+obj-$(CONFIG_HID_SIMPLE_MSNEK4K)        += usbnek4k.o
 obj-$(CONFIG_USB_GTCO)         += gtco.o
 
 ifeq ($(CONFIG_USB_DEBUG),y)
drivers/usb/input/usbnek4k.c +252 -0

252 lines not on this page · raw message