aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-11-09 15:48:50 -0500
committerTom Rini <trini@konsulko.com>2020-11-09 15:48:50 -0500
commitb3f48734384aab649422d789447aa8a12d4eb716 (patch)
treeb91282bbc88ad9f8e4272608077500fd61b447bf /drivers
parent74f11b55df961170223d22e0daea13b095013514 (diff)
parenta322f54f50cfb2e8e7a68968c060b2fd3dbd934d (diff)
downloadu-boot-b3f48734384aab649422d789447aa8a12d4eb716.tar.gz
Merge tag 'efi-2021-01-rc2-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-01-rc2 (2) The following bugs are fixed: * The conitrace command failed to build. * Non-volatile UEFI variables were not delete form the file store. The following features are added: * Support for the FN1 - FN10 keys on crosswire keyboards is added. * An EFI binary is provided to dump the binary device tree. tpm2_get_capability() is adjusted in preparation of the implementation of the EFI_TCG2_PROTOCOL.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/input.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index da264f4166e..c1c5e428dca 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -170,21 +170,35 @@ static struct kbd_entry {
};
/*
- * Scan key code to ANSI 3.64 escape sequence table. This table is
- * incomplete in that it does not include all possible extra keys.
+ * The table contains conversions from scan key codes to ECMA-48 escape
+ * sequences. The same sequences exist in the withdrawn ANSI 3.64 standard.
+ *
+ * As all escape sequences start with 0x1b this byte has been removed.
+ *
+ * This table is incomplete in that it does not include all possible extra keys.
*/
static struct {
int kbd_scan_code;
char *escape;
} kbd_to_ansi364[] = {
- { KEY_UP, "\033[A"},
- { KEY_DOWN, "\033[B"},
- { KEY_RIGHT, "\033[C"},
- { KEY_LEFT, "\033[D"},
+ { KEY_UP, "[A"},
+ { KEY_LEFT, "[D"},
+ { KEY_RIGHT, "[C"},
+ { KEY_DOWN, "[B"},
+ { KEY_F1, "OP"},
+ { KEY_F2, "OQ"},
+ { KEY_F3, "OR"},
+ { KEY_F4, "OS"},
+ { KEY_F5, "[15~"},
+ { KEY_F6, "[17~"},
+ { KEY_F7, "[18~"},
+ { KEY_F8, "[19~"},
+ { KEY_F9, "[20~"},
+ { KEY_F10, "[21~"},
};
/* Maximum number of output characters that an ANSI sequence expands to */
-#define ANSI_CHAR_MAX 3
+#define ANSI_CHAR_MAX 5
static int input_queue_ascii(struct input_config *config, int ch)
{
@@ -417,6 +431,7 @@ static int input_keycode_to_ansi364(struct input_config *config,
for (i = ch_count = 0; i < ARRAY_SIZE(kbd_to_ansi364); i++) {
if (keycode != kbd_to_ansi364[i].kbd_scan_code)
continue;
+ output_ch[ch_count++] = 0x1b;
for (escape = kbd_to_ansi364[i].escape; *escape; escape++) {
if (ch_count < max_chars)
output_ch[ch_count] = *escape;
@@ -473,7 +488,7 @@ static int input_keycodes_to_ascii(struct input_config *config,
/* Start conversion by looking for the first new keycode (by same). */
for (i = same; i < num_keycodes; i++) {
int key = keycode[i];
- int ch;
+ int ch = 0xff;
/*
* For a normal key (with an ASCII value), add it; otherwise
@@ -492,10 +507,10 @@ static int input_keycodes_to_ascii(struct input_config *config,
}
if (ch_count < max_chars && ch != 0xff)
output_ch[ch_count++] = (uchar)ch;
- } else {
+ }
+ if (ch == 0xff)
ch_count += input_keycode_to_ansi364(config, key,
output_ch, max_chars);
- }
}
if (ch_count > max_chars) {