From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGlK2-0006Cf-Pg for qemu-devel@nongnu.org; Fri, 21 Feb 2014 03:19:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGlJs-0001oU-D3 for qemu-devel@nongnu.org; Fri, 21 Feb 2014 03:19:02 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:60415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGlJs-0001oJ-4M for qemu-devel@nongnu.org; Fri, 21 Feb 2014 03:18:52 -0500 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Feb 2014 01:18:51 -0700 From: Michael Roth Date: Fri, 21 Feb 2014 02:17:14 -0600 Message-Id: <1392970647-21528-39-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1392970647-21528-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1392970647-21528-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 38/51] mainstone: Fix duplicate array values for key 'space' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lersek@redhat.com, qemu-stable@nongnu.org, Petar.Jovanovic@imgtec.com From: 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 Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev (cherry picked from commit 7dbc1158bc63fdbad849d21409eeeb53f5230445) Signed-off-by: Michael Roth --- 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..ffbf4bd 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -75,9 +75,18 @@ static struct keymap map[0xE0] = { [0x2c] = {4,3}, /* z */ [0xc7] = {5,0}, /* Home */ [0x2a] = {5,1}, /* shift */ - [0x39] = {5,2}, /* space */ + /* + * 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 second one. + */ + /* [0x39] = {5,2}, space */ [0x39] = {5,3}, /* space */ - [0x1c] = {5,5}, /* enter */ + /* + * 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.9.5