Re: [linux-usb-devel] [PATCH] usb/hid:Microsoft Natural Ergonomic Keyboard 4000 Driver 0.5.0

2007-03-05 Thread Liyu
Robert Marquardt wrote:
 Li Yu wrote:
 +#define USAGE_ZOOM_IN0x22d

 I have a 100K file of probably all HID usages available.
 It started its life as a conversion to Pascal of hidusage.h but is now
 10 times bigger than that file. I can easily convert this back to C.
 Is there any interest in the file? Is it completely legal to do so?

Thanks.

It is great resource, and I guess its legality is decided by the license
of source file.

-Li Yu

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] usb/hid:Microsoft Natural Ergonomic Keyboard 4000 Driver 0.5.0

2007-03-05 Thread Liyu

I think the source file should be the original data source (MS file),
The Pascal file is one derivation of from, it still may be under the MS
license.

That is my guess, I am not familiar with the legal very well.


Robert Marquardt wrote:
 Liyu wrote:

 It is great resource, and I guess its legality is decided by the license
 of source file.

 The question is What is the source file?. My Pascal conversion or
 the MS original. The Pascal conversion is only using the names from
 Microsoft so the file is compatible but not a copy.
 I will put the conversion back to C under the GPL of course.

 If it is legal i want the file in the kernel sources to encourage all
 developers (kernel or user) to use symolic usage names instead of hex
 cvalues.



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] usb/hid:Microsoft Natural Ergonomic Keyboard 4000 Driver 0.5.0

2007-03-04 Thread Li Yu
Changelogs:

1. Port to HID simple driver layer 0.5.0.

It can be applied on 2.6.21 at least.

Signed-off-by: Liyu [EMAIL PROTECTED]

--- linux-2.6.18/drivers/usb/input.orig/usbnek4k.c  1970-01-01 
08:00:00.0 +0800
+++ linux-2.6.18/drivers/usb/input/usbnek4k.c   2006-10-12 13:29:28.0 
+0800
@@ -0,0 +1,252 @@
+/*
+ *  Microsoft Natural Ergonomic Keyboard 4000 Driver
+ *
+ *  Version:   0.4.0
+ *
+ *  Copyright (c) 2006 Li Yu [EMAIL PROTECTED]
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/input.h
+#include hid.h
+#include hid-simple.h
+
+static int ascii_keycode;
+module_param(ascii_keycode, bool, 0444);
+MODULE_PARM_DESC(ascii_keycode, Only yield ASCII keycodes when turn on this, 
default=n);
+
+#define USAGE_ZOOM_IN  0x22d
+#define USAGE_ZOOM_OUT 0x22e
+#define USAGE_HOME 0x223
+#define USAGE_SEARCH   0x221
+#define USAGE_EMAIL0x18a
+#define USAGE_FAVORITES0x182
+#define USAGE_MUTE 0xe2
+#define USAGE_VOLUME_DOWN  0xea
+#define USAGE_VOLUME_UP0xe9
+#define USAGE_PLAY_PAUSE   0xcd
+#define USAGE_CALCULATOR   0x192
+#define USAGE_BACK 0x224
+#define USAGE_FORWARD  0x225
+#define USAGE_CUSTOM   0xff05
+
+#define USAGE_CUSTOM_RELEASE   0x0
+#define USAGE_CUSTOM_1 0x1
+#define USAGE_CUSTOM_2 0x2
+#define USAGE_CUSTOM_3 0x4
+#define USAGE_CUSTOM_4 0x8
+#define USAGE_CUSTOM_5 0x10
+
+#define USAGE_HELP 0x95
+#define USAGE_UNDO 0x21a
+#define USAGE_REDO 0x279
+#define USAGE_NEW  0x201
+#define USAGE_OPEN 0x202
+#define USAGE_CLOSE0x203
+
+#define USAGE_REPLY0x289
+#define USAGE_FWD  0x28b
+#define USAGE_SEND 0x28c
+#define USAGE_SPELL0x1ab
+#define USAGE_SAVE 0x207
+#define USAGE_PRINT0x208
+
+#define USAGE_KEYPAD_EQUAL 0x67
+#define USAGE_KEYPAD_LEFT_PAREN0xb6
+#define USAGE_KEYPAD_RIGHT_PAREN   0xb7
+
+#define MSNEK4K_ID_VENDOR  0x045e
+#define MSNEK4K_ID_PRODUCT 0x00db
+
+#define map_key(c) do { usage-code = c; usage-type = EV_KEY; 
set_bit(c,input-keybit); } while (0)
+#define clear_key(c) do { usage-code = 0; usage-type = 0; 
clear_bit(c,input-keybit); } while (0)
+
+static struct usb_device_id nek4k_id_table[] = {
+   { USB_DEVICE(MSNEK4K_ID_VENDOR, MSNEK4K_ID_PRODUCT) },
+   {}
+};
+
+MODULE_DEVICE_TABLE(usb, nek4k_id_table);
+MODULE_DESCRIPTION(Microsoft Natural Ergonomic Keyboard 4000 Driver);
+MODULE_VERSION(0.4.0);
+
+struct usage_block consumer_usage_block[] = {
+   USAGE_BLOCK(USAGE_ZOOM_IN, 0, EV_KEY, KEY_F13, 0),
+   USAGE_BLOCK(USAGE_ZOOM_OUT, 0, EV_KEY, KEY_F14, 0),
+   USAGE_BLOCK(USAGE_HOME, 0, EV_KEY, KEY_HOMEPAGE, 0),
+   USAGE_BLOCK(USAGE_SEARCH, 0, EV_KEY, KEY_SEARCH, 0),
+   USAGE_BLOCK(USAGE_EMAIL, 0, EV_KEY, KEY_EMAIL, 0),
+   USAGE_BLOCK(USAGE_MUTE, 0, EV_KEY, KEY_MUTE, 0),
+   USAGE_BLOCK(USAGE_VOLUME_DOWN, 0, EV_KEY, KEY_VOLUMEDOWN, 0),
+   USAGE_BLOCK(USAGE_VOLUME_UP, 0, EV_KEY, KEY_VOLUMEUP, 0),
+   USAGE_BLOCK(USAGE_PLAY_PAUSE, 0, EV_KEY, KEY_PLAYPAUSE, 0),
+   USAGE_BLOCK(USAGE_CALCULATOR, 0, EV_KEY, KEY_CALC, 0),
+   USAGE_BLOCK(USAGE_BACK, 0, EV_KEY, KEY_BACK, 0),
+   USAGE_BLOCK(USAGE_FORWARD, 0, EV_KEY, KEY_FORWARD, 0),
+   USAGE_BLOCK(USAGE_HELP, 0, EV_KEY, KEY_HELP, 0),
+   USAGE_BLOCK(USAGE_UNDO, 0, EV_KEY, KEY_UNDO, 0),
+   USAGE_BLOCK(USAGE_REDO, 0, EV_KEY, KEY_REDO, 0),
+   USAGE_BLOCK(USAGE_NEW, 0, EV_KEY, KEY_NEW, 0),
+   USAGE_BLOCK(USAGE_OPEN, 0, EV_KEY, KEY_OPEN, 0),
+   USAGE_BLOCK(USAGE_CLOSE, 0, EV_KEY, KEY_CLOSE, 0),
+   USAGE_BLOCK(USAGE_REPLY, 0, EV_KEY, KEY_REPLY, 0),
+   USAGE_BLOCK(USAGE_FWD, 0, EV_KEY, KEY_FORWARDMAIL, 0),
+   USAGE_BLOCK(USAGE_SEND, 0, EV_KEY, KEY_SEND, 0),
+   USAGE_BLOCK(USAGE_SPELL, 0, EV_KEY, KEY_F15, 0),
+   USAGE_BLOCK(USAGE_SAVE, 0, EV_KEY, KEY_SAVE, 0),
+   USAGE_BLOCK(USAGE_PRINT, 0, EV_KEY, KEY_PRINT, 0),
+   USAGE_BLOCK_NULL
+};
+
+struct usage_block msvendor_usage_block[] = {
+   USAGE_BLOCK(USAGE_CUSTOM, USAGE_CUSTOM_1, EV_KEY, KEY_FN_F1, 0),
+   USAGE_BLOCK(USAGE_CUSTOM, USAGE_CUSTOM_2, EV_KEY, KEY_FN_F2, 0),
+   USAGE_BLOCK(USAGE_CUSTOM, USAGE_CUSTOM_3, EV_KEY, KEY_FN_F3, 0),
+   USAGE_BLOCK(USAGE_CUSTOM, USAGE_CUSTOM_4, EV_KEY, KEY_FN_F4, 0),
+   USAGE_BLOCK(USAGE_CUSTOM, USAGE_CUSTOM_5, EV_KEY, KEY_FN_F5, 0),
+   USAGE_BLOCK_NULL
+};
+
+struct usage_block keyboard_usage_block[] = {
+   USAGE_BLOCK(USAGE_KEYPAD_EQUAL, 0, EV_KEY, KEY_KPEQUAL, 0),
+   USAGE_BLOCK(USAGE_KEYPAD_LEFT_PAREN, 0, EV_KEY, KEY_KPLEFTPAREN, 0),
+   USAGE_BLOCK(USAGE_KEYPAD_RIGHT_PAREN, 0, EV_KEY, KEY_KPRIGHTPAREN, 0),
+   USAGE_BLOCK_NULL
+};
+
+struct usage_page_block