[parisc-linux-cvs] linux deller

Helge Deller deller@gmx.de
Tue, 2 Jul 2002 23:04:15 +0200


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

On Tuesday 02 July 2002 23:03, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	deller	02/07/02 15:03:35
>
> Modified files:
> 	drivers/hil    : hil_kbd.c
>
> Log message:
> activate numeric key pad,
> cursor keys don't work as expected yet.

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

Index: hil_kbd.c
===================================================================
RCS file: /var/cvs/linux/drivers/hil/hil_kbd.c,v
retrieving revision 1.3
diff -u -p -r1.3 hil_kbd.c
--- hil_kbd.c	2002/07/01 23:17:09	1.3
+++ hil_kbd.c	2002/07/02 21:02:37
@@ -56,7 +56,7 @@ uint8_t hil_kbd_set1[128] = {
    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_KP1,		KEY_SLASH/*KP*/,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,
@@ -221,7 +221,8 @@ static void hil_kbd_process_record(struc
 			up = key & HIL_KBD_SET2_UPBIT;
 			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
 			key = key >> HIL_KBD_SET2_SHIFT;
-			input_report_key(dev, key, !up);
+			if (key != KEY_RESERVED && key != KEY_UNKNOWN)
+				input_report_key(dev, key, !up);
 		}
 		break;
 	case HIL_POL_CHARTYPE_SET3:
@@ -232,7 +233,8 @@ static void hil_kbd_process_record(struc
 			up = key & HIL_KBD_SET3_UPBIT;
 			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
 			key = key >> HIL_KBD_SET3_SHIFT;
-			input_report_key(dev, hil_kbd_set3[key], !up);
+			if (key != KEY_RESERVED && key != KEY_UNKNOWN)
+				input_report_key(dev, hil_kbd_set3[key], !up);
 		}
 		break;
 	}
@@ -376,6 +378,12 @@ static void hil_kbd_connect(struct serio
 	}
 
 	input_register_device(&kbd->dev);
+
+	/* HIL keyboards don't have a numlock key,
+	 * simulate a up-down sequence of numlock to 
+	 * make the keypad work at expected. */
+	input_report_key(&kbd->dev, KEY_NUMLOCK, 1);
+	input_report_key(&kbd->dev, KEY_NUMLOCK, 0);
 
 	return;
  bail1:

--Boundary-00=_PVhI9y/eyqeS0Z4--