qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] mainstone: Fix duplicate array values for key 'space'
@ 2013-12-22 19:01 Stefan Weil
  2013-12-22 19:20 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2013-12-22 19:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Stefan Weil

cgcc reported a duplicate initialisation. Mainstone includes a matrix
keyboard where two different positions map to 'space'.

QEMU uses the reversed mapping and does not map 'space' to two different
matrix positions.

Some other keys are either missing or might be mapped wrongly (cf. Linux
kernel code). Don't fix these until someone can test them with real
hardware, but add TODO comments.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---

v2: Address Peter Maydell's suggestions:
    * Use first alternative, so there is no change of behaviour
    * Don't use #if 0 ... #endif

As there won't be a follow up patch to fix the keyboard matrix,
this patch is no longer needed for qemu-stable.

Please note that checkpatch.pl reports a missing blank after
a comma. This was required to match the existing code.

Regards,
Stefan W.

 hw/arm/mainstone.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c
index 9402c84..bfb2b78 100644
--- a/hw/arm/mainstone.c
+++ b/hw/arm/mainstone.c
@@ -76,8 +76,17 @@ static struct keymap map[0xE0] = {
     [0xc7] = {5,0}, /* Home */
     [0x2a] = {5,1}, /* shift */
     [0x39] = {5,2}, /* space */
-    [0x39] = {5,3}, /* space */
-    [0x1c] = {5,5}, /*  enter */
+    /*
+     * There are two matrix positions which map to space,
+     * but QEMU can only use one of them for the reverse
+     * mapping, so simply use the first one.
+     */
+    /* [0x39] = {5,3}, space */
+    /*
+     * Matrix position {5,4} and other keys are missing here.
+     * TODO: Compare with Linux code and test real hardware.
+     */
+    [0x1c] = {5,5}, /* enter (TODO: might be wrong) */
     [0xc8] = {6,0}, /* up */
     [0xd0] = {6,1}, /* down */
     [0xcb] = {6,2}, /* left */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-22 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-22 19:01 [Qemu-devel] [PATCH v2] mainstone: Fix duplicate array values for key 'space' Stefan Weil
2013-12-22 19:20 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).