From patchwork Sun Sep 28 21:13:24 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: 4992561 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 91AB19F2BB for ; Sun, 28 Sep 2014 21:23:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B60C52021B for ; Sun, 28 Sep 2014 21:23:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D6B320172 for ; Sun, 28 Sep 2014 21:23:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753595AbaI1VXL (ORCPT ); Sun, 28 Sep 2014 17:23:11 -0400 Received: from mx-out-2.rwth-aachen.de ([134.130.5.187]:51635 "EHLO mx-out-2.rwth-aachen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753581AbaI1VXL convert rfc822-to-8bit (ORCPT ); Sun, 28 Sep 2014 17:23:11 -0400 X-Greylist: delayed 582 seconds by postgrey-1.27 at vger.kernel.org; Sun, 28 Sep 2014 17:23:10 EDT X-IronPort-AV: E=Sophos;i="5.04,615,1406584800"; d="scan'208";a="262733190" Received: from hub1.rwth-ad.de (HELO mail.rwth-aachen.de) ([134.130.26.142]) by mx-2.rz.rwth-aachen.de with ESMTP; 28 Sep 2014 23:13:27 +0200 Received: from pebbles.site (78.48.74.205) by mail.rwth-aachen.de (134.130.26.142) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 28 Sep 2014 23:13:26 +0200 From: Stefan =?ISO-8859-1?Q?Br=FCns?= To: Subject: [PATCH] Input: atkbd - correct MSC_SCAN events for force_release keys Date: Sun, 28 Sep 2014 23:13:24 +0200 Message-ID: <2075303.cGkXBhvpNe@pebbles.site> User-Agent: KMail/4.14.1 (Linux/3.16.3-1.gd2bbe7f-desktop; KDE/4.14.1; 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=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 --- drivers/input/keyboard/atkbd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) { 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); }