Re: [PATCH][RFC] add support for PC-9800 architecture (13/26) keyboard

Vojtech Pavlik (vojtech@suse.cz)
Tue, 22 Oct 2002 12:43:32 +0200


On Thu, Oct 17, 2002 at 08:40:04PM +0900, Osamu Tomita wrote:

> Summary:
> console keyboard modules
> - adapted to PC-9800 hardware spec.
> - add jis-x201("kana") support.

I won't merge this unless it's cleaned up, kana support either made
generic or put into keymaps, and the below problems resolved.

> patch:
> diff -urN linux/drivers/char/defkeymap_pc9800.c linux98/drivers/char/defkeymap_pc9800.c
> --- linux/drivers/char/defkeymap_pc9800.c Thu Jan 1 09:00:00 1970
> +++ linux98/drivers/char/defkeymap_pc9800.c Mon Sep 16 10:47:44 2002
> @@ -0,0 +1,285 @@
> +
> +/* Do not edit this file! It was automatically generated by */
> +/* loadkeys --mktable defkeymap_pc9800.map > defkeymap_pc9800.c */
> +
> +#include <linux/config.h>
> +#include <linux/types.h>
> +#include <linux/keyboard.h>
> +#include <linux/kd.h>
> +
> +u_short plain_map[NR_KEYS] = {
> + 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037,
> + 0xf038, 0xf039, 0xf030, 0xf02d, 0xf05e, 0xf05c, 0xf07f, 0xf009,
> + 0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69,
> + 0xfb6f, 0xfb70, 0xf040, 0xf05b, 0xf201, 0xfb61, 0xfb73, 0xfb64,
> + 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf03b, 0xf03a,

> diff -urN linux/drivers/char/defkeymap_pc9800.map linux98/drivers/char/defkeymap_pc9800.map
> --- linux/drivers/char/defkeymap_pc9800.map Thu Jan 1 09:00:00 1970
> +++ linux98/drivers/char/defkeymap_pc9800.map Mon Sep 16 11:26:41 2002
> @@ -0,0 +1,439 @@
> +charset "jis-x-0201"
> +keymaps 0-2,4,6,8,12,16-17,20
> +keycode 0 = Escape
> +keycode 1 = one exclam
> + alt keycode 1 = Meta_Escape
> + kana keycode 1 = kana_nu
> + shift kana keycode 1 = kana_nu

... no way I'll add another default keymap when now we have unified
keycodes. And we do support japanese keycodes/keymappings.

> diff -urN linux/drivers/char/keyboard.c linux98/drivers/char/keyboard.c
> --- linux/drivers/char/keyboard.c Sat Oct 12 13:21:42 2002
> +++ linux98/drivers/char/keyboard.c Sat Oct 12 14:18:52 2002
> @@ -44,6 +44,9 @@
>
> static void kbd_disconnect(struct input_handle *handle);
> extern void ctrl_alt_del(void);
> +#ifdef CONFIG_PC9800
> +extern void do_change_kanji_mode(int, unsigned long);
> +#endif

Either there is a need for a special kanji mode changing function for
japanese keyboards or there is not. Either way, it isn't PC-98 specific.

> /*
> * Exported functions/variables
> @@ -58,7 +61,11 @@
> * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
> * This seems a good reason to start with NumLock off.
> */
> +#ifndef CONFIG_PC9800
> #define KBD_DEFLEDS 0
> +#else
> +#define KBD_DEFLEDS (1 << VC_NUMLOCK)
> +#endif
> #endif

You want numlock on by default?

> #ifdef CONFIG_MAGIC_SYSRQ
> unsigned char kbd_sysrq_xlate[128] =
> +#ifndef CONFIG_PC9800
> "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
> "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
> "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
> @@ -152,6 +181,15 @@
> "\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */
> "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
> "\r\000/"; /* 0x60 - 0x6f */
> +#else /* CONFIG_PC9800 */
> + "\0331234567890-^\\\177\t" /* 0x00 - 0x0f */
> + "qwertyuiop@[\rasd" /* 0x10 - 0x1f */
> + "fghjkl;:]zxcvbnm" /* 0x20 - 0x2f */
> + ",./_ \000\000\000\000\177\000\000\000\000\000\000" /* 0x30 - 0x3f */
> + "-/789*456+123=0," /* 0x40 - 0x4f */
> + ".\000\213\214\215\216\217\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
> + "\000\000\201\202\203\204\205\206\207\210\211\212"; /* 0x60 - 0x6f */
> +#endif /* !CONFIG_PC9800 */

The keycodes are defined constants. They do not change between
architectures. So this table also must be constant.

> @@ -535,12 +582,20 @@
>
> static void fn_scroll_forw(struct vc_data *vc)
> {
> +#ifndef CONFIG_PC9800
> scrollfront(0);
> +#else
> + scrollfront(3);
> +#endif
> }

Huh?

> static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
> {
> +#ifndef CONFIG_PC9800
> if (up_flag)
> +#else
> + if (up_flag && value != 7 && value != 0x14) /* caps/kana lock */
> +#endif

Very ugly. This should be handled by the keymap.

> diff -urN linux/include/linux/logibusmouse.h linux98/include/linux/logibusmouse.h
> --- linux/include/linux/logibusmouse.h Tue Aug 3 01:54:29 1999
> +++ linux98/include/linux/logibusmouse.h Fri Aug 17 22:15:13 2001

Hmm, this file isn't used at all in 2.5. Why patching it?

> diff -urN linux/include/linux/pc_keyb.h linux98/include/linux/pc_keyb.h
> --- linux/include/linux/pc_keyb.h Tue Oct 12 02:15:40 1999
> +++ linux98/include/linux/pc_keyb.h Fri Aug 17 22:15:13 2001

And this one isn't either.

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/