From: "Pali Rohár" <pali@kernel.org>
To: u-boot@lists.denx.de, maemo-leste@lists.dyne.org
Subject: [PATCH] Nokia RX-51: Fix double space key press
Date: Sun, 9 Oct 2022 21:38:25 +0200 [thread overview]
Message-ID: <20221009193825.12854-1-pali@kernel.org> (raw)
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>
---
board/nokia/rx51/rx51.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 9548c3c7be71..c1b4b91b6070 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 */
--
2.20.1
next reply other threads:[~2022-10-09 19:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 19:38 Pali Rohár [this message]
2022-10-12 19:14 ` [PATCH] Nokia RX-51: Fix double space key press Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221009193825.12854-1-pali@kernel.org \
--to=pali@kernel.org \
--cc=maemo-leste@lists.dyne.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox