From 04429a17719d7d50b8b11408f8ccb51ca2a79a6c Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Thu, 17 Sep 2009 21:32:39 +0800 Subject: [PATCH] Fn-modifier-keys-work --- .../files-2.6.31/drivers/char/defkeymap.c | 30 ++-- .../510-Fn-modifier-keys-work.patch | 136 ++++++++++++++++++ 2 files changed, 151 insertions(+), 15 deletions(-) create mode 100644 target/linux/xburst/patches-2.6.31/510-Fn-modifier-keys-work.patch diff --git a/target/linux/xburst/files-2.6.31/drivers/char/defkeymap.c b/target/linux/xburst/files-2.6.31/drivers/char/defkeymap.c index b51e0e6a5..bf077c0f7 100644 --- a/target/linux/xburst/files-2.6.31/drivers/char/defkeymap.c +++ b/target/linux/xburst/files-2.6.31/drivers/char/defkeymap.c @@ -12,13 +12,13 @@ u_short plain_map[NR_KEYS] = { 0xfb6f, 0xfb70, 0xf05b, 0xf05d, 0xf201, 0xf702, 0xfb61, 0xfb73, 0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf03b, 0xf027, 0xf060, 0xf700, 0xf05c, 0xfb7a, 0xfb78, 0xfb63, 0xfb76, - 0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf700, 0xf30c, + 0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf701, 0xf30c, 0xf703, 0xf020, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf208, 0xf209, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301, 0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf03c, 0xf10a, 0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf30e, 0xf701, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, + 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, 0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, @@ -47,13 +47,13 @@ static u_short shift_map[NR_KEYS] = { 0xfb4f, 0xfb50, 0xf07b, 0xf07d, 0xf201, 0xf702, 0xfb41, 0xfb53, 0xfb44, 0xfb46, 0xfb47, 0xfb48, 0xfb4a, 0xfb4b, 0xfb4c, 0xf03a, 0xf022, 0xf07e, 0xf700, 0xf07c, 0xfb5a, 0xfb58, 0xfb43, 0xfb56, - 0xfb42, 0xfb4e, 0xfb4d, 0xf03c, 0xf03e, 0xf03f, 0xf700, 0xf30c, + 0xfb42, 0xfb4e, 0xfb4d, 0xf03c, 0xf03e, 0xf03f, 0xf701, 0xf30c, 0xf703, 0xf020, 0xf207, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf10e, 0xf10f, 0xf110, 0xf111, 0xf112, 0xf113, 0xf213, 0xf203, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301, 0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf03e, 0xf10a, 0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf30e, 0xf701, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, + 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, 0xf20b, 0xf601, 0xf602, 0xf117, 0xf600, 0xf20a, 0xf115, 0xf116, 0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, @@ -81,14 +81,14 @@ static u_short altgr_map[NR_KEYS] = { 0xf021, 0xf040, 0xf023, 0xf024, 0xf025, 0xf05e, 0xf026, 0xf02a, 0xf028, 0xf029, 0xf200, 0xf07e, 0xf201, 0xf702, 0xf16d, 0xf16e, 0xf16f, 0xf02d, 0xf05f, 0xf07b, 0xf05b, 0xf05d, 0xf07d, 0xf200, - 0xf200, 0xf200, 0xf700, 0xf030, 0xfb7a, 0xfb78, 0xf916, 0xfb76, - 0xf915, 0xf03c, 0xf03e, 0xf027, 0xf022, 0xf200, 0xf700, 0xf30c, + 0xf200, 0xf200, 0xf700, 0xf200, 0xf039, 0xf030, 0xf916, 0xfb76, + 0xf915, 0xf03c, 0xf03e, 0xf027, 0xf022, 0xf200, 0xf701, 0xf30c, 0xf703, 0xf200, 0xf207, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, 0xf514, 0xf515, 0xf208, 0xf202, 0xf911, 0xf912, 0xf913, 0xf30b, 0xf90e, 0xf90f, 0xf910, 0xf30a, 0xf90b, 0xf90c, 0xf90d, 0xf90a, 0xf310, 0xf206, 0xf200, 0xf07c, 0xf516, 0xf517, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf30e, 0xf701, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, + 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, 0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, @@ -117,13 +117,13 @@ static u_short ctrl_map[NR_KEYS] = { 0xf00f, 0xf010, 0xf01b, 0xf01d, 0xf201, 0xf702, 0xf001, 0xf013, 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, 0xf007, 0xf000, 0xf700, 0xf01c, 0xf01a, 0xf018, 0xf003, 0xf016, - 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf20e, 0xf07f, 0xf700, 0xf30c, + 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf20e, 0xf07f, 0xf701, 0xf30c, 0xf703, 0xf000, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf208, 0xf204, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301, 0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf200, 0xf10a, 0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf30e, 0xf701, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, + 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, 0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, @@ -152,13 +152,13 @@ static u_short shift_ctrl_map[NR_KEYS] = { 0xf00f, 0xf010, 0xf200, 0xf200, 0xf201, 0xf702, 0xf001, 0xf013, 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, 0xf200, 0xf200, 0xf700, 0xf200, 0xf01a, 0xf018, 0xf003, 0xf016, - 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf700, 0xf30c, + 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf701, 0xf30c, 0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf208, 0xf200, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301, 0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf30e, 0xf701, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, + 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, 0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, @@ -187,13 +187,13 @@ static u_short alt_map[NR_KEYS] = { 0xf86f, 0xf870, 0xf85b, 0xf85d, 0xf80d, 0xf702, 0xf861, 0xf873, 0xf864, 0xf866, 0xf867, 0xf868, 0xf86a, 0xf86b, 0xf86c, 0xf83b, 0xf827, 0xf860, 0xf700, 0xf85c, 0xf87a, 0xf878, 0xf863, 0xf876, - 0xf862, 0xf86e, 0xf86d, 0xf200, 0xf200, 0xf82f, 0xf700, 0xf30c, + 0xf862, 0xf86e, 0xf86d, 0xf200, 0xf200, 0xf82f, 0xf701, 0xf30c, 0xf703, 0xf820, 0xf207, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, 0xf505, 0xf506, 0xf507, 0xf508, 0xf509, 0xf208, 0xf209, 0xf907, 0xf908, 0xf909, 0xf30b, 0xf904, 0xf905, 0xf906, 0xf30a, 0xf901, 0xf902, 0xf903, 0xf900, 0xf310, 0xf206, 0xf200, 0xf83c, 0xf50a, 0xf50b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf30e, 0xf701, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, + 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, 0xf118, 0xf210, 0xf211, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, 0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, @@ -222,13 +222,13 @@ static u_short ctrl_alt_map[NR_KEYS] = { 0xf80f, 0xf810, 0xf200, 0xf200, 0xf201, 0xf702, 0xf801, 0xf813, 0xf804, 0xf806, 0xf807, 0xf808, 0xf80a, 0xf80b, 0xf80c, 0xf200, 0xf200, 0xf200, 0xf700, 0xf200, 0xf81a, 0xf818, 0xf803, 0xf816, - 0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf200, 0xf700, 0xf30c, + 0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf200, 0xf701, 0xf30c, 0xf703, 0xf200, 0xf207, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, 0xf505, 0xf506, 0xf507, 0xf508, 0xf509, 0xf208, 0xf200, 0xf307, 0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301, 0xf302, 0xf303, 0xf300, 0xf20c, 0xf206, 0xf200, 0xf200, 0xf50a, 0xf50b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf30e, 0xf701, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, + 0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603, 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf20c, 0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, diff --git a/target/linux/xburst/patches-2.6.31/510-Fn-modifier-keys-work.patch b/target/linux/xburst/patches-2.6.31/510-Fn-modifier-keys-work.patch new file mode 100644 index 000000000..bc6e85300 --- /dev/null +++ b/target/linux/xburst/patches-2.6.31/510-Fn-modifier-keys-work.patch @@ -0,0 +1,136 @@ +diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c +index 5859589..ddd7d3f 100644 +--- a/arch/mips/jz4740/platform.c ++++ b/arch/mips/jz4740/platform.c +@@ -242,11 +242,11 @@ static struct platform_device jz_nand_device = { + * don't define this. the keyboard and keyboard both work + */ + +-#define KEY_QI_QI KEY_F13 +-#define KEY_QI_UPRED KEY_RIGHTCTRL ++#define KEY_QI_QI KEY_RIGHTCTRL ++#define KEY_QI_UPRED KEY_RIGHTSHIFT + #define KEY_QI_VOLUP KEY_F15 + #define KEY_QI_VOLDOWN KEY_F16 +-#define KEY_QI_FN KEY_F17 ++#define KEY_QI_FN KEY_RIGHTCTRL + + static const uint32_t qi_lb60_keymap[] = { + KEY(0, 0, KEY_F1), /* S2 */ +diff --git a/drivers/char/defkeymap.map b/drivers/char/defkeymap.map +index 25d05b4..497cfc2 100644 +--- a/drivers/char/defkeymap.map ++++ b/drivers/char/defkeymap.map +@@ -113,9 +113,9 @@ keycode 43 = backslash bar + control keycode 43 = Control_backslash + alt keycode 43 = Meta_backslash + keycode 44 = z +- altgr keycode 43 = nine ++ altgr keycode 44 = nine + keycode 45 = x +- altgr keycode 43 = zero ++ altgr keycode 45 = zero + keycode 46 = c + altgr keycode 46 = Hex_C + keycode 47 = v +@@ -133,7 +133,7 @@ keycode 52 = period greater + keycode 53 = slash question + control keycode 53 = Delete + alt keycode 53 = Meta_slash +-keycode 54 = Shift ++keycode 54 = AltGr + keycode 55 = KP_Multiply + keycode 56 = Alt + keycode 57 = space space +@@ -240,7 +240,7 @@ keycode 93 = + keycode 94 = + keycode 95 = + keycode 96 = KP_Enter +-keycode 97 = AltGr ++keycode 97 = Control + keycode 98 = KP_Divide + keycode 99 = Control_backslash + control keycode 99 = Control_backslash +diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c +index 737be95..4cdd9ac 100644 +--- a/drivers/char/keyboard.c ++++ b/drivers/char/keyboard.c +@@ -121,6 +121,8 @@ struct vt_spawn_console vt_spawn_con = { + .sig = 0, + }; + ++static int ctrlr = 0; ++ + /* + * Variables exported for vt.c + */ +@@ -1133,6 +1135,60 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char u + } + #endif + ++static int qi_keymap(int keysym, int keycode, int up_flag) ++{ ++ int ret; ++ ret = keysym; ++ ++ if (up_flag && keycode == KEY_RIGHTCTRL) { ++ ctrlr = 0; ++ return ret; ++ } ++ ++ if (ctrlr) { ++ switch (keycode) { ++ case KEY_SLASH: /* 0 */ ++ ret = 61488; ++ break; ++ case KEY_N: /* 1 */ ++ ret = 61489; ++ break; ++ case KEY_M: /* 2 */ ++ ret = 61490; ++ break; ++ case KEY_B: /* 3 */ ++ ret = 61491; ++ break; ++ case KEY_J: /* 4 */ ++ ret = 61492; ++ break; ++ case KEY_K: /* 5 */ ++ ret = 61493; ++ break; ++ case KEY_L: /* 6 */ ++ ret = 61494; ++ break; ++ case KEY_U: /* 7 */ ++ ret = 61495; ++ break; ++ case KEY_I: /* 8 */ ++ ret = 61496; ++ break; ++ case KEY_O: /* 9 */ ++ ret = 61497; ++ break; ++ default: ++ break; ++ } ++ } ++ ++ if (keycode == KEY_RIGHTCTRL) { ++ ctrlr = 1; ++ } ++ ++ return ret; ++} ++ + static void kbd_rawcode(unsigned char data) + { + struct vc_data *vc = vc_cons[fg_console].d; +@@ -1284,6 +1340,8 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) + if (raw_mode && type != KT_SPEC && type != KT_SHIFT) + return; + ++ keysym = qi_keymap(keysym, keycode, !down); ++ + (*k_handler[type])(vc, keysym & 0xff, !down); + + param.ledstate = kbd->ledflagstate;