From patchwork Thu Sep 6 23:40:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schmitz X-Patchwork-Id: 10591297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66AD8921 for ; Thu, 6 Sep 2018 23:41:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 512C62B257 for ; Thu, 6 Sep 2018 23:41:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 411CD2B26E; Thu, 6 Sep 2018 23:41:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF04A2B257 for ; Thu, 6 Sep 2018 23:41:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725931AbeIGES7 (ORCPT ); Fri, 7 Sep 2018 00:18:59 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45619 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbeIGES7 (ORCPT ); Fri, 7 Sep 2018 00:18:59 -0400 Received: by mail-pf1-f194.google.com with SMTP id i26-v6so6036400pfo.12 for ; Thu, 06 Sep 2018 16:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9ch+U+1aoVWldSEGvKM3RgHJtFYI87aLbeMy1g2exaI=; b=En2FS+LHuC8+Ut80LWB4QTCYn6uoQvyIZLSKG1BBwAUlmxBdvXPPxh90Q2Lxq1WE+u MgwLJ4g9ObljPYuY1js6iBWoHkHOn2nFEAJ64G5CX8Ybc4wboQSzPBg5JXmYKCfY9rA9 TWhkriubyA8xoX30v7FSfnDeNkpnebReg+03DHbdWIN6M0KHqSeLcMaDp2w91hC/S+5A RgAFABwE0FIuZgHdlHfQfmrxXMScPq+CYs/cbJ+kEgu/Ka27rB+5EyDiLVcNNRj0Cqo9 7HXefXKJupuz2aDFK4IJxQ3NVKDyf79u9xNmANUfEAQaa912V8tR5J+mZts0lgCpG2Ip +M6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9ch+U+1aoVWldSEGvKM3RgHJtFYI87aLbeMy1g2exaI=; b=dHqr/f2caYxQBY5kO0eZ88CqQ8JIvhZh2KAxKQr/xMfpr9ihFHmf4MMn0BDefD3aR3 on7Wc2mIlsgSxR98Gy1RvvbMeYbYkAz/Z/3D+pnsPZy3U9VBw1uj3WQaQnDnZw6TayXe 9WsWDvK0pzooo+uzhVSJyvO3GpUGgl44LltamoTTjy7iHsZZ45DzxDTCu/8h3lW9/s9E 1SzfhOhiFjCmygwsKMtNMepOAgSohzFypiUnr8ePFMZHRpFcCfMMItW7IF9QyDds82gc 0Vk4bLQFI7zdrI3c3V/M4h7rNRzv+Qa6U8r/Ah3vLr8u4AmUTJeFIPDhqnTVnGXtHdfF NQ9A== X-Gm-Message-State: APzg51AVseVHbJOVyvNff1sQCU+2I+EHC6MD+uORRRYWwuCh1KqnD3pB IlMJW1lOqY3r8WfUHp/JtTk= X-Google-Smtp-Source: ANB0VdaW0P+um/4uxH+W73jpTQ1MCVlI9cnaj5fw9LI6LDXqpnz7zn6dh6dQM1+DG9yUMlDYJvK/Xw== X-Received: by 2002:a63:db4f:: with SMTP id x15-v6mr5162091pgi.214.1536277265200; Thu, 06 Sep 2018 16:41:05 -0700 (PDT) Received: from xplor.waratah.dyndns.org (222-154-41-72-adsl.sparkbb.co.nz. [222.154.41.72]) by smtp.gmail.com with ESMTPSA id y86-v6sm9035202pfk.84.2018.09.06.16.41.04 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 06 Sep 2018 16:41:04 -0700 (PDT) Received: by xplor.waratah.dyndns.org (Postfix, from userid 1000) id D9A23360081; Fri, 7 Sep 2018 11:41:00 +1200 (NZST) From: Michael Schmitz To: linux-input@vger.kernel.org Cc: debian-68k@lists.debian.org, linux-m68k@lists.linux-m68k.org, Andreas Schwab , Michael Schmitz Subject: [PATCH 1/2] input: atakbd.c - fix Atari keymap Date: Fri, 7 Sep 2018 11:40:42 +1200 Message-Id: <1536277243-3821-2-git-send-email-schmitzmic@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1536277243-3821-1-git-send-email-schmitzmic@gmail.com> References: <1536277243-3821-1-git-send-email-schmitzmic@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andreas Schwab Fix errors in Atari keymap (mostly in keypad, help and undo keys). Patch provided on debian-68k ML by Andreas Schwab , keymap array size and unhandled scancode limit adjusted to 0x73 by me. Tested-by: Michael Schmitz Signed-off-by: Michael Schmitz Signed-off-by: Andreas Schwab --- drivers/input/keyboard/atakbd.c | 64 ++++++++++++++++----------------------- 1 files changed, 26 insertions(+), 38 deletions(-) diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c index 6f62da2..e989574 100644 --- a/drivers/input/keyboard/atakbd.c +++ b/drivers/input/keyboard/atakbd.c @@ -75,8 +75,7 @@ */ -static unsigned char atakbd_keycode[0x72] = { /* American layout */ - [0] = KEY_GRAVE, +static unsigned char atakbd_keycode[0x73] = { /* American layout */ [1] = KEY_ESC, [2] = KEY_1, [3] = KEY_2, @@ -117,9 +116,9 @@ [38] = KEY_L, [39] = KEY_SEMICOLON, [40] = KEY_APOSTROPHE, - [41] = KEY_BACKSLASH, /* FIXME, '#' */ + [41] = KEY_GRAVE, [42] = KEY_LEFTSHIFT, - [43] = KEY_GRAVE, /* FIXME: '~' */ + [43] = KEY_BACKSLASH, [44] = KEY_Z, [45] = KEY_X, [46] = KEY_C, @@ -145,45 +144,34 @@ [66] = KEY_F8, [67] = KEY_F9, [68] = KEY_F10, - [69] = KEY_ESC, - [70] = KEY_DELETE, - [71] = KEY_KP7, - [72] = KEY_KP8, - [73] = KEY_KP9, + [71] = KEY_HOME, + [72] = KEY_UP, [74] = KEY_KPMINUS, - [75] = KEY_KP4, - [76] = KEY_KP5, - [77] = KEY_KP6, + [75] = KEY_LEFT, + [77] = KEY_RIGHT, [78] = KEY_KPPLUS, - [79] = KEY_KP1, - [80] = KEY_KP2, - [81] = KEY_KP3, - [82] = KEY_KP0, - [83] = KEY_KPDOT, - [90] = KEY_KPLEFTPAREN, - [91] = KEY_KPRIGHTPAREN, - [92] = KEY_KPASTERISK, /* FIXME */ - [93] = KEY_KPASTERISK, - [94] = KEY_KPPLUS, - [95] = KEY_HELP, + [80] = KEY_DOWN, + [82] = KEY_INSERT, + [83] = KEY_DELETE, [96] = KEY_102ND, - [97] = KEY_KPASTERISK, /* FIXME */ - [98] = KEY_KPSLASH, + [97] = KEY_UNDO, + [98] = KEY_HELP, [99] = KEY_KPLEFTPAREN, [100] = KEY_KPRIGHTPAREN, [101] = KEY_KPSLASH, [102] = KEY_KPASTERISK, - [103] = KEY_UP, - [104] = KEY_KPASTERISK, /* FIXME */ - [105] = KEY_LEFT, - [106] = KEY_RIGHT, - [107] = KEY_KPASTERISK, /* FIXME */ - [108] = KEY_DOWN, - [109] = KEY_KPASTERISK, /* FIXME */ - [110] = KEY_KPASTERISK, /* FIXME */ - [111] = KEY_KPASTERISK, /* FIXME */ - [112] = KEY_KPASTERISK, /* FIXME */ - [113] = KEY_KPASTERISK /* FIXME */ + [103] = KEY_KP7, + [104] = KEY_KP8, + [105] = KEY_KP9, + [106] = KEY_KP4, + [107] = KEY_KP5, + [108] = KEY_KP6, + [109] = KEY_KP1, + [110] = KEY_KP2, + [111] = KEY_KP3, + [112] = KEY_KP0, + [113] = KEY_KPDOT, + [114] = KEY_KPENTER, }; static struct input_dev *atakbd_dev; @@ -191,7 +179,7 @@ static void atakbd_interrupt(unsigned char scancode, char down) { - if (scancode < 0x72) { /* scancodes < 0xf2 are keys */ + if (scancode < 0x73) { /* scancodes < 0xf3 are keys */ // report raw events here? @@ -205,7 +193,7 @@ static void atakbd_interrupt(unsigned char scancode, char down) input_report_key(atakbd_dev, scancode, down); input_sync(atakbd_dev); } - } else /* scancodes >= 0xf2 are mouse data, most likely */ + } else /* scancodes >= 0xf3 are mouse data, most likely */ printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode); return; From patchwork Thu Sep 6 23:40:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schmitz X-Patchwork-Id: 10591299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 792E9921 for ; Thu, 6 Sep 2018 23:41:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67BCA2B260 for ; Thu, 6 Sep 2018 23:41:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AF2C2B270; Thu, 6 Sep 2018 23:41:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01CB42B260 for ; Thu, 6 Sep 2018 23:41:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725954AbeIGETJ (ORCPT ); Fri, 7 Sep 2018 00:19:09 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45020 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbeIGETJ (ORCPT ); Fri, 7 Sep 2018 00:19:09 -0400 Received: by mail-pl1-f194.google.com with SMTP id ba4-v6so5686374plb.11 for ; Thu, 06 Sep 2018 16:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6d9IixKL/AepiBKNJW4/jNGMHLnpeF8AoAOMDlwvKlQ=; b=gCoTwTRKYMepVYMsY6xjEtMyBHLEbEsbAmNVa3pyrWK/6gLLKlmx35JiN5mS+CXN/G fMBV/XtwkEJMTFSkMch1zYQvLh7PVMCpvptTSHrrdsMm0LXtMPVq6w4tD3u+PDL2uM3A wYaVnwI5cDnr3pzAMEFT2Jkkz2OISxcyzObI1nmg73d3LM5YZSIgc+/pyE56WMuYtLJC W65/+YFb2HKBot7myFdOx1lYXGhcXYyTN6w8/Y7ucw76+65M9eTqOI4HE5APxDrFBzL3 9LhVLqeq+8NlSW4BbvEqvpb0ELHZxRpS3Q+cPvHTYaG4GEbXrGZkjLJgZByOzvP6BpmA Gtig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6d9IixKL/AepiBKNJW4/jNGMHLnpeF8AoAOMDlwvKlQ=; b=DyveZ2yUNc5tELath5YsCO7TlCuPe/hSXXMOL6MfDydDZQJVcJ5HjMAVqiJbHJ3qyt +sNW12LUU4uu2YFJNgS8H24RVCoQYY8rilNocj894CuGLu3uHMOeGbDf+IsRMjXSW4ZX yuPKm2QmZl0HiGToVjMqREZdKQSqifRDnH37cTUzYiD/tLjHF0ziKduPGJ5fBtgb8vi7 SOHzUeQ29KSaiXVV0uwnJfNdAj8WXj8K7VwlP20Oj+AiQ7hy5lfHUYT0GSyE0W7vfGHW 9NJTelUa3sRkZz6kfU/MCH3SzI5h96RNdVBbafO1L12mJAk1VTxhikn+gjFwdap0hd1H EhMQ== X-Gm-Message-State: APzg51C3U8UzIGvBN51HR1pf2XmsoP0ekVfpfp0gzao6kivkWU+nMK2q 0vR9bpgjuyM8/6xOgKMpcXA= X-Google-Smtp-Source: ANB0Vdb3od7fTDCUtHtr0TvrNDhQdaEUIHeDuQ+QGEU90dgsSBJrKp6Cj0qvk2Lpe4dQcBpWuMjHEQ== X-Received: by 2002:a17:902:bf0b:: with SMTP id bi11-v6mr5280281plb.76.1536277275928; Thu, 06 Sep 2018 16:41:15 -0700 (PDT) Received: from xplor.waratah.dyndns.org (222-154-41-72-adsl.sparkbb.co.nz. [222.154.41.72]) by smtp.gmail.com with ESMTPSA id b21-v6sm11691012pfe.148.2018.09.06.16.41.15 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 06 Sep 2018 16:41:15 -0700 (PDT) Received: by xplor.waratah.dyndns.org (Postfix, from userid 1000) id 3C967360081; Fri, 7 Sep 2018 11:41:12 +1200 (NZST) From: Michael Schmitz To: linux-input@vger.kernel.org Cc: debian-68k@lists.debian.org, linux-m68k@lists.linux-m68k.org, Michael Schmitz Subject: [PATCH 2/2] input: atakbd.c - fix Atari CapsLock behaviour Date: Fri, 7 Sep 2018 11:40:43 +1200 Message-Id: <1536277243-3821-3-git-send-email-schmitzmic@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1536277243-3821-1-git-send-email-schmitzmic@gmail.com> References: <1536277243-3821-1-git-send-email-schmitzmic@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The CapsLock key on Atari keyboards is not a toggle, it does send the normal make and break scancodes. Drop the CapsLock toggle handling code, which did cause the CapsLock key to merely act as a Shift key. Tested-by: Michael Schmitz Signed-off-by: Michael Schmitz Signed-off-by: Andreas Schwab --- drivers/input/keyboard/atakbd.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c index e989574..6caee80 100644 --- a/drivers/input/keyboard/atakbd.c +++ b/drivers/input/keyboard/atakbd.c @@ -185,14 +185,8 @@ static void atakbd_interrupt(unsigned char scancode, char down) scancode = atakbd_keycode[scancode]; - if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */ - input_report_key(atakbd_dev, scancode, 1); - input_report_key(atakbd_dev, scancode, 0); - input_sync(atakbd_dev); - } else { - input_report_key(atakbd_dev, scancode, down); - input_sync(atakbd_dev); - } + input_report_key(atakbd_dev, scancode, down); + input_sync(atakbd_dev); } else /* scancodes >= 0xf3 are mouse data, most likely */ printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode);