From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10ABBC433FE for ; Sun, 9 Oct 2022 19:39:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9C58084ED9; Sun, 9 Oct 2022 21:39:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="O3nhc1Gp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED5D684DCD; Sun, 9 Oct 2022 21:39:01 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E40458483E for ; Sun, 9 Oct 2022 21:38:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A699E60B85; Sun, 9 Oct 2022 19:38:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E61F0C433D6; Sun, 9 Oct 2022 19:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665344337; bh=XNqhGsSdmwlB3R8IZOlxlYC3PtF4KUIeUWja+WFeqsY=; h=From:To:Subject:Date:From; b=O3nhc1GploNS0k+Rfv0J7qEt73uqqsUchEFf89GsNa8x+JT6YmuUmZ2jLjgkewQFY fs3gYuCDtRCX87VuiWusvpbl+XRoEW84SZTrpVMmnJFG4GkzyvOwl16QjMcMN9W64W 2rOsk2PwNwUep1KPzQHBIcG3WN6aW3Tz2F2gSHRKSv6CE6S5RNTSM/D0AcHjEGI9YD e9f4kKuy8JEXQCiK4mok8fox16KwLL7bbIfxAeDPm/x7fPxPxM9qel+TPTRYyba/aH Qd3pbfUbNGuHsz3OVd0G9tAwMslR0Okahz5aC2S2ed+XTdMLAGtqaznmH85VZJiKZ7 sdahlCfF5Wtqg== Received: by pali.im (Postfix) id 76C837C1; Sun, 9 Oct 2022 21:38:54 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= 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 Message-Id: <20221009193825.12854-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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 --- 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