[parisc-linux-cvs] linux-2.4.18-pa46: HIL keyboard fixes

Helge Deller deller@gmx.de
Tue, 2 Jul 2002 01:20:25 +0200


--Boundary-00=_5OOI9cKjOVWcpze
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline

On Tuesday 02 July 2002 01:17, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	deller	02/07/01 17:17:09
>
> Modified files:
> 	.              : Makefile
> 	drivers/hil    : hil_kbd.c
>
> Log message:
> linux-2.4.18-pa46:
> - try to correct some HIL keys (not yet completely OK!),
> - left-in some debugging info (commented out).



--Boundary-00=_5OOI9cKjOVWcpze
Content-Type: text/plain;
  charset="iso-8859-1";
  name=" "
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="diff"

Index: Makefile
===================================================================
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.316
diff -u -p -r1.316 Makefile
--- Makefile	2002/06/30 15:00:12	1.316
+++ Makefile	2002/07/01 23:14:38
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 18
-EXTRAVERSION = -pa45
+EXTRAVERSION = -pa46
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: drivers/hil/hil_kbd.c
===================================================================
RCS file: /var/cvs/linux/drivers/hil/hil_kbd.c,v
retrieving revision 1.2
diff -u -p -r1.2 hil_kbd.c
--- drivers/hil/hil_kbd.c	2002/06/30 15:00:12	1.2
+++ drivers/hil/hil_kbd.c	2002/07/01 23:14:39
@@ -52,23 +52,38 @@ MODULE_LICENSE("Dual BSD/GPL");
 #define HIL_KBD_SET1_SHIFT 1
 
 uint8_t hil_kbd_set1[128] = {
-    6,   0 /* cursor repeat */, 127, 127, 54, 42, 29, 99, 
-   75,  72,  76,  73,  77,  71, 124,  96,
-   79,  98,  80,  78,  81,  55,  82,  74,
-   48,  47,  46,  45,  44, 220,   0,   1,
-    7,  68,   4,  87,  83,  67,  15 /* KPTAB */,  88,
-   35,  34,  33,  32,  31,  30,   0,  58,
-   22,  21,  20,  19,  18,  17,  16,  15,
-    8,   7,   6,   5,   4,   3,   2,  41,
-    /* for buttons use a device-specific driver */
-    0,   0,   0,   0,   0,   0,   0,   0, 
-   139, 62,  61,  60,  59,   9, 128,  28,
-    99, 63,  64,  65,  66,  10, 137/* CLEAR_LINE*/, 173/* CLEAR_DISPLAY */,
-    9,  10,  11,  12,  13,  14, 110/* KPINSERT_LINE */, 111/* KPDELETE_LINE */,
-    23, 24,  25,  26,  27,  43, 110, 111, 
-    36, 37,  38,  39,  40,  28, 102, 177/* KPPREV */,
-    50, 51,  52,  53,   0, 134/*Select*/, 0, 178/* KPNEXT */,
-    49, 57, 178/*Next*/, 220, 105, 108, 103, 106
+   KEY_5,		KEY_RESERVED,	KEY_RIGHTALT,	KEY_LEFTALT, 
+   KEY_RIGHTSHIFT,	KEY_LEFTSHIFT,	KEY_LEFTCTRL,	KEY_SYSRQ,
+   KEY_KP4,		KEY_KP8,	KEY_KP5,	KEY_KP9,
+   KEY_KP6,		KEY_KP7,	KEY_KPCOMMA,	KEY_KPENTER,
+   KEY_KP1,		KEY_KPSLASH,	KEY_KP2,	KEY_KPPLUS,
+   KEY_KP3,		KEY_KPASTERISK,	KEY_KP0,	KEY_KPMINUS,
+   KEY_B,		KEY_V,		KEY_C,		KEY_X,
+   KEY_Z,		KEY_UNKNOWN,	KEY_RESERVED,   KEY_ESC,
+   KEY_6,		KEY_F10,	KEY_3,		KEY_F11,
+   KEY_KPDOT,		KEY_F9,		KEY_TAB/*KPTAB*/,KEY_F12,
+   KEY_H,		KEY_G,		KEY_F,		KEY_D,
+   KEY_S,		KEY_A,		KEY_RESERVED,	KEY_CAPSLOCK,
+   KEY_U,		KEY_Y,		KEY_T,		KEY_R,
+   KEY_E,		KEY_W,		KEY_Q,		KEY_TAB,
+   KEY_7,		KEY_6,		KEY_5,		KEY_4,
+   KEY_3,		KEY_2,		KEY_1,		KEY_GRAVE,
+   KEY_INTL1,		KEY_INTL2,	KEY_INTL3,	KEY_INTL4, /*Buttons*/
+   KEY_INTL5,		KEY_INTL6,	KEY_INTL7,	KEY_INTL8,
+   KEY_MENU,		KEY_F4,		KEY_F3,		KEY_F2,
+   KEY_F1,		KEY_VOLUMEUP,	KEY_STOP,	KEY_SENDFILE/*Enter/Print*/, 
+   KEY_SYSRQ,		KEY_F5,		KEY_F6,		KEY_F7,
+   KEY_F8,		KEY_VOLUMEDOWN,	KEY_CUT /*CLEAR_LINE*/, KEY_REFRESH /*CLEAR_DISPLAY*/,
+   KEY_8,		KEY_9,		KEY_0,		KEY_MINUS,
+   KEY_EQUAL,		KEY_BACKSPACE,	KEY_INSERT/*KPINSERT_LINE*/, KEY_DELETE /*KPDELETE_LINE*/,
+   KEY_I,		KEY_O,		KEY_P,		KEY_LEFTBRACE,
+   KEY_RIGHTBRACE,	KEY_BACKSLASH,	KEY_INSERT,	KEY_DELETE,
+   KEY_J,		KEY_K,		KEY_L,		KEY_SEMICOLON,
+   KEY_APOSTROPHE,	KEY_ENTER,	KEY_HOME,	KEY_SCROLLUP,
+   KEY_M,		KEY_COMMA,	KEY_DOT,	KEY_SLASH,
+   KEY_RESERVED,	KEY_OPEN/*Select*/,KEY_RESERVED,KEY_SCROLLDOWN/*KPNEXT*/,
+   KEY_N,		KEY_SPACE,	KEY_SCROLLDOWN/*Next*/, KEY_UNKNOWN,
+   KEY_LEFT,		KEY_DOWN,	KEY_UP,		KEY_RIGHT
 };
 
 #define HIL_KBD_SET2_UPBIT 0x01
@@ -189,10 +204,13 @@ static void hil_kbd_process_record(struc
 			unsigned int key;
 			int up;
 			key = kbd->data[cnt++];
+/* printk("KEY1 = 0x%02x  ",key); */
 			up = key & HIL_KBD_SET1_UPBIT;
 			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
 			key = key >> HIL_KBD_SET1_SHIFT;
-			input_report_key(dev, hil_kbd_set1[key], !up);
+/* printk("send = %d\n",hil_kbd_set1[key]); */
+			if (key != KEY_RESERVED && key != KEY_UNKNOWN)
+				input_report_key(dev, hil_kbd_set1[key], !up);
 		}
 		break;
 	case HIL_POL_CHARTYPE_SET2:
@@ -352,10 +370,10 @@ static void hil_kbd_connect(struct serio
 
 	kbd->dev.evbit[0] |= BIT(EV_KEY);
 
-	for (i = 0; i < 128; i++)
+	for (i = 0; i < 128; i++) {
 		set_bit(hil_kbd_set1[i], kbd->dev.keybit);
-	for (i = 0; i < 128; i++)
 		set_bit(hil_kbd_set3[i], kbd->dev.keybit);
+	}
 
 	input_register_device(&kbd->dev);
 

--Boundary-00=_5OOI9cKjOVWcpze--