aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-10-09 21:38:25 +0200
committerTom Rini <trini@konsulko.com>2022-10-12 08:57:15 -0400
commitb8074b44ca8ffc1df049e14483adc444b6b6d190 (patch)
treea1f2f84786fed424a19483f3f996e4454963cfd3
parentd93ab1006d408a3ca7a9eb16d4f4640af72a4452 (diff)
downloadu-boot-WIP/2022-10-12-additional-fixes.zip
u-boot-WIP/2022-10-12-additional-fixes.tar.gz
u-boot-WIP/2022-10-12-additional-fixes.tar.bz2
Nokia RX-51: Fix double space key pressWIP/2022-10-12-additional-fixes
Space key is indicated by two different bits. Some HW models indicate press of space key only by the first bit. Qemu indicates it by both bits at the same time, which is currently interpreted by u-boot as double key press. Fix this issue by setting first bit when only second is set (to support HW models which indicate press only by second bit) and always clearing second bit before processing to not report double space key press. Signed-off-by: Pali Rohár <pali@kernel.org>
-rw-r--r--board/nokia/rx51/rx51.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 9548c3c..c1b4b91 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -561,7 +561,7 @@ static const char keymap[] = {
'q', 'o', 'p', ',', '\b', 0, 'a', 's',
'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l',
'e', '.', 0, '\r', 0, 'z', 'x', 'c',
- 'r', 'v', 'b', 'n', 'm', ' ', ' ', 0,
+ 'r', 'v', 'b', 'n', 'm', ' ', 0, 0,
't', 0, 0, 0, 0, 0, 0, 0,
'y', 0, 0, 0, 0, 0, 0, 0,
'u', 0, 0, 0, 0, 0, 0, 0,
@@ -691,6 +691,10 @@ static int rx51_kp_tstc(struct udevice *dev)
mods = keys[4] >> 4;
keys[4] &= 0x0f;
+ /* space key is indicated by two different bits */
+ keys[3] |= (keys[3] & (1 << 6)) >> 1;
+ keys[3] &= ~(1 << 6);
+
for (c = 0; c < 8; c++) {
/* get newly pressed keys only */