From patchwork Mon Jun 10 18:53:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 10985301 X-Patchwork-Delegate: jikos@jikos.cz 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 BF6C21398 for ; Mon, 10 Jun 2019 18:53:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC68828759 for ; Mon, 10 Jun 2019 18:53:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EDCC2876E; Mon, 10 Jun 2019 18:53:52 +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=-7.9 required=2.0 tests=BAYES_00,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 3CE3328759 for ; Mon, 10 Jun 2019 18:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388843AbfFJSxv (ORCPT ); Mon, 10 Jun 2019 14:53:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:46108 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388109AbfFJSxv (ORCPT ); Mon, 10 Jun 2019 14:53:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7F20FABD5; Mon, 10 Jun 2019 18:53:50 +0000 (UTC) From: Nicolas Saenz Julienne To: Jiri Kosina , Benjamin Tissoires Cc: dmitry.torokhov@gmail.com, Nicolas Saenz Julienne , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: input: fix a4tech horizontal wheel custom usage id Date: Mon, 10 Jun 2019 20:53:43 +0200 Message-Id: <20190610185343.27614-1-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 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 Some a4tech mice use the 'GenericDesktop.00b8' usage id to inform whether the previous wheel report was horizontal or vertical. Before c01908a14bf73 ("HID: input: add mapping for "Toggle Display" key") this usage id was being mapped to 'Relative.Misc'. After the patch it's simply ignored (usage->type == 0 & usage->code == 0). Checking the HID Usage Tables it turns out it's a reserved usage_id, so it makes sense to map it the way it was. Ultimately this makes hid-a4tech ignore the WHEEL/HWHEEL selection event, as it has no usage->type. The patch reverts the handling of the usage id back to it's previous behavior. Fixes: c01908a14bf73 ("HID: input: add mapping for "Toggle Display" key") Signed-off-by: Nicolas Saenz Julienne --- drivers/hid/hid-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 63855f275a38..6a956d5a195e 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -671,7 +671,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel if ((usage->hid & 0xf0) == 0xb0) { /* SC - Display */ switch (usage->hid & 0xf) { case 0x05: map_key_clear(KEY_SWITCHVIDEOMODE); break; - default: goto ignore; + default: goto unknown; } break; }