2007-12-12 18:22:19

by Kristoffer Ericson

[permalink] [raw]
Subject: [HP6XX/FIX/PATCH] - Fix bad default keymap in HP Jornada 6xx keyboard driver

Greetings,

Dmitry, any chance of getting this into the RC since its really a bugfix?
Anyhow, compiled cleanly with patch applied.

shortlog:
* This patch fixes the HP Jornada 6xx keyboard default keymap which had some bad keymap values. This resulted in wrong
key being returned when pressed (example : key y returned 'r').
* Also, while we are at it lets arrange the include files in alphabetical order.

signed-off-by: Kristoffer Ericson <[email protected]>

diff --git a/drivers/input/keyboard/jornada680_kbd.c b/drivers/input/keyboard/jornada680_kbd.c
index bec1cf4..a23633a 100644
--- a/drivers/input/keyboard/jornada680_kbd.c
+++ b/drivers/input/keyboard/jornada680_kbd.c
@@ -16,14 +16,14 @@
* published by the Free Software Foundation.
*/

-#include <linux/input.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
#include <linux/init.h>
+#include <linux/input.h>
#include <linux/input-polldev.h>
+#include <linux/interrupt.h>
#include <linux/jiffies.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/interrupt.h>

#include <asm/delay.h>
#include <asm/io.h>
@@ -43,22 +43,22 @@
#define PLDR 0xa4000134

static const unsigned short jornada_scancodes[] = {
-/* PTD1 */ KEY_CAPSLOCK, KEY_MACRO, KEY_LEFTCTRL, 0, KEY_ESC, 0, 0, 0, /* 1 -> 8 */
- KEY_F1, KEY_F2, KEY_F3, KEY_F8, KEY_F7, KEY_F2, KEY_F4, KEY_F5, /* 9 -> 16 */
-/* PTD5 */ KEY_SLASH, KEY_APOSTROPHE, KEY_ENTER, 0, KEY_Z, 0, 0, 0, /* 17 -> 24 */
- KEY_X, KEY_C, KEY_V, KEY_DOT, KEY_COMMA, KEY_M, KEY_B, KEY_N, /* 25 -> 32 */
-/* PTD7 */ KEY_KP2, KEY_KP6, 0, 0, 0, 0, 0, 0, /* 33 -> 40 */
- 0, 0, 0, KEY_KP4, 0, 0, KEY_LEFTALT, KEY_HANJA, /* 41 -> 48 */
-/* PTE0 */ 0, 0, 0, 0, KEY_FINANCE, 0, 0, 0, /* 49 -> 56 */
- KEY_LEFTCTRL, 0, KEY_SPACE, KEY_KPDOT, KEY_VOLUMEUP, 249, 0, 0, /* 57 -> 64 */
-/* PTE1 */ KEY_SEMICOLON, KEY_RIGHTBRACE, KEY_BACKSLASH, 0, KEY_A, 0, 0, 0,/* 65 -> 72 */
- KEY_S, KEY_D, KEY_F, KEY_L, KEY_K, KEY_J, KEY_G, KEY_H, /* 73 -> 80 */
-/* PTE3 */ KEY_KP8, KEY_LEFTMETA, KEY_RIGHTSHIFT, 0, KEY_TAB, 0, 0,0, /* 81 -> 88 */
- 0, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 89 -> 96 */
-/* PTE6 */ KEY_P, KEY_LEFTBRACE, KEY_BACKSPACE, 0, KEY_Q, 0, 0, 0, /* 97 -> 104 */
- KEY_W, KEY_E, KEY_R, KEY_O, KEY_I, KEY_U, KEY_T, KEY_R, /* 105 -> 112 */
-/* PTE7 */ KEY_0, KEY_MINUS, KEY_EQUAL, 0, KEY_1, 0, 0, 0, /* 113 -> 120 */
- KEY_2, KEY_3, KEY_4, KEY_9, KEY_8, KEY_7, KEY_5, KEY_6, /* 121 -> 128 */
+/* PTD1 */ KEY_CAPSLOCK, KEY_MACRO, KEY_LEFTCTRL, 0, KEY_ESC, KEY_KP5, 0, 0, /* 1 -> 8 */
+ KEY_F1, KEY_F2, KEY_F3, KEY_F8, KEY_F7, KEY_F6, KEY_F4, KEY_F5, /* 9 -> 16 */
+/* PTD5 */ KEY_SLASH, KEY_APOSTROPHE, KEY_ENTER, 0, KEY_Z, 0, 0, 0, /* 17 -> 24 */
+ KEY_X, KEY_C, KEY_V, KEY_DOT, KEY_COMMA, KEY_M, KEY_B, KEY_N, /* 25 -> 32 */
+/* PTD7 */ KEY_KP2, KEY_KP6, KEY_KP3, 0, 0, 0, 0, 0, /* 33 -> 40 */
+ KEY_F10, KEY_RO, KEY_F9, KEY_KP4, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_LEFTALT, KEY_HANJA, /* 41 -> 48 */
+/* PTE0 */ KEY_KATAKANA, KEY_KP0, KEY_GRAVE, 0, KEY_FINANCE, 0, 0, 0, /* 49 -> 56 */
+ KEY_KPMINUS, KEY_HIRAGANA, KEY_SPACE, KEY_KPDOT, KEY_VOLUMEUP, 249, 0, 0, /* 57 -> 64 */
+/* PTE1 */ KEY_SEMICOLON, KEY_RIGHTBRACE, KEY_BACKSLASH, 0, KEY_A, 0, 0, 0, /* 65 -> 72 */
+ KEY_S, KEY_D, KEY_F, KEY_L, KEY_K, KEY_J, KEY_G, KEY_H, /* 73 -> 80 */
+/* PTE3 */ KEY_KP8, KEY_LEFTMETA, KEY_RIGHTSHIFT, 0, KEY_TAB, 0, 0, 0, /* 81 -> 88 */
+ 0, KEY_LEFTSHIFT, KEY_KP7, KEY_KP9, KEY_KP1, KEY_F11, KEY_KPPLUS, KEY_KPASTERISK, /* 89 -> 96 */
+/* PTE6 */ KEY_P, KEY_LEFTBRACE, KEY_BACKSPACE, 0, KEY_Q, 0, 0, 0, /* 97 -> 104 */
+ KEY_W, KEY_E, KEY_R, KEY_O, KEY_I, KEY_U, KEY_T, KEY_Y, /* 105 -> 112 */
+/* PTE7 */ KEY_0, KEY_MINUS, KEY_EQUAL, 0, KEY_1, 0, 0, 0, /* 113 -> 120 */
+ KEY_2, KEY_3, KEY_4, KEY_9, KEY_8, KEY_7, KEY_5, KEY_6, /* 121 -> 128 */
/* **** */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0
};


Attachments:
hp6xx-keyboard-keymap-fix.patch (3.45 kB)

2007-12-12 18:46:31

by Paul Mundt

[permalink] [raw]
Subject: Re: [HP6XX/FIX/PATCH] - Fix bad default keymap in HP Jornada 6xx keyboard driver

On Wed, Dec 12, 2007 at 07:22:07PM +0100, Kristoffer Ericson wrote:
> shortlog:
> * This patch fixes the HP Jornada 6xx keyboard default keymap which had some bad keymap values. This resulted in wrong
> key being returned when pressed (example : key y returned 'r').
> * Also, while we are at it lets arrange the include files in alphabetical order.
>
You do realize that the default keymap was written for the Japanese units
and the Japanese keyboards, right? From the looks of it, you are just
trying to swap one functional set for another. I can assure you that this
keymap worked fine on the Japanese units, so calling it a bug is a bit
misleading.

2007-12-12 18:55:23

by Kristoffer Ericson

[permalink] [raw]
Subject: Re: [HP6XX/FIX/PATCH] - Fix bad default keymap in HP Jornada 6xx keyboard driver

On Thu, 13 Dec 2007 03:45:58 +0900
Paul Mundt <[email protected]> wrote:

> On Wed, Dec 12, 2007 at 07:22:07PM +0100, Kristoffer Ericson wrote:
> > shortlog:
> > * This patch fixes the HP Jornada 6xx keyboard default keymap which had some bad keymap values. This resulted in wrong
> > key being returned when pressed (example : key y returned 'r').
> > * Also, while we are at it lets arrange the include files in alphabetical order.
> >
> You do realize that the default keymap was written for the Japanese units
> and the Japanese keyboards, right? From the looks of it, you are just
> trying to swap one functional set for another. I can assure you that this
> keymap worked fine on the Japanese units, so calling it a bug is a bit
> misleading.

Mostly true yes. However a few errors entered simply due to me copying the keymap poorly in the initial keymap. So it does infact have 'bug' keys that wouldn't work properly on neither japanese / european / US jornadas. And whatever functional set, this patch fixes those
bugs.

2007-12-16 12:51:53

by Paul Mundt

[permalink] [raw]
Subject: Re: [HP6XX/FIX/PATCH] - Fix bad default keymap in HP Jornada 6xx keyboard driver

On Wed, Dec 12, 2007 at 07:54:52PM +0100, Kristoffer Ericson wrote:
> On Thu, 13 Dec 2007 03:45:58 +0900
> Paul Mundt <[email protected]> wrote:
> > On Wed, Dec 12, 2007 at 07:22:07PM +0100, Kristoffer Ericson wrote:
> > > * This patch fixes the HP Jornada 6xx keyboard default keymap which
> > > had some bad keymap values. This resulted in wrong key being
> > > returned when pressed (example : key y returned 'r').
> > >
> > You do realize that the default keymap was written for the Japanese units
> > and the Japanese keyboards, right? From the looks of it, you are just
> > trying to swap one functional set for another. I can assure you that this
> > keymap worked fine on the Japanese units, so calling it a bug is a bit
> > misleading.
>
> Mostly true yes. However a few errors entered simply due to me copying
> the keymap poorly in the initial keymap. So it does infact have 'bug'
> keys that wouldn't work properly on neither japanese / european / US
> jornadas. And whatever functional set, this patch fixes those bugs.
>
Ah, ok, so it's a problem with the new driver, rather than something
that's always been broken. No objections then, thanks for clearing that
up.