From patchwork Sun Nov 16 22:18:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Br=C3=BCns?= X-Patchwork-Id: 5315131 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D1D01C11AC for ; Sun, 16 Nov 2014 22:18:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AAE2F20120 for ; Sun, 16 Nov 2014 22:18:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5053A2011E for ; Sun, 16 Nov 2014 22:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbaKPWSe (ORCPT ); Sun, 16 Nov 2014 17:18:34 -0500 Received: from mx-out-2.rwth-aachen.de ([134.130.5.187]:25007 "EHLO mx-out-2.rwth-aachen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbaKPWSd convert rfc822-to-8bit (ORCPT ); Sun, 16 Nov 2014 17:18:33 -0500 X-IronPort-AV: E=Sophos;i="5.07,398,1413237600"; d="scan'208";a="270828388" Received: from hub2.rwth-ad.de (HELO mail.rwth-aachen.de) ([134.130.26.143]) by mx-2.rz.rwth-aachen.de with ESMTP; 16 Nov 2014 23:18:32 +0100 Received: from pebbles.site (78.48.150.130) by mail.rwth-aachen.de (134.130.26.143) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 16 Nov 2014 23:18:31 +0100 From: Stefan =?ISO-8859-1?Q?Br=FCns?= To: CC: Dmitry Torokhov Subject: [PATCH] Input: atkbd - correct MSC_SCAN events for force_release keys Date: Sun, 16 Nov 2014 23:18:31 +0100 Message-ID: <45706882.ZrxtpIdaNX@pebbles.site> User-Agent: KMail/4.14.2 (Linux/3.16.6-2-desktop; KDE/4.14.2; x86_64; ; ) MIME-Version: 1.0 X-PMWin-Version: 3.1.3.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Without the change either no scancode would be reported on release of force_release keys, or - if the key is marked as force_release erroneously - the release event and the scancode would be reported in separate reports to the input layer. Signed-off-by: Stefan BrĂ¼ns --- Originally sent on 28.9.2014, but somehow got lost. Resending as per Dmitrys request from 24.10.2014 drivers/input/keyboard/atkbd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) case ATKBD_KEY_NULL: @@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, input_sync(dev); if (value && test_bit(code, atkbd->force_release_mask)) { + input_event(dev, EV_MSC, MSC_SCAN, code); input_report_key(dev, keycode, 0); input_sync(dev); } diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 2dd1d0d..6375ae6 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -456,8 +456,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, keycode = atkbd->keycode[code]; - if (keycode != ATKBD_KEY_NULL) - input_event(dev, EV_MSC, MSC_SCAN, code); + if (!(atkbd->release && test_bit(code, atkbd->force_release_mask))) + if (keycode != ATKBD_KEY_NULL) + input_event(dev, EV_MSC, MSC_SCAN, code); switch (keycode) {