From patchwork Tue Feb 16 17:38:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Cl=C3=A9ment_VUCHENER?= X-Patchwork-Id: 8330041 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 08C07C02AA for ; Tue, 16 Feb 2016 17:38:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34C0C20295 for ; Tue, 16 Feb 2016 17:38:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A2B12028D for ; Tue, 16 Feb 2016 17:38:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755033AbcBPRie (ORCPT ); Tue, 16 Feb 2016 12:38:34 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:35250 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754993AbcBPRid (ORCPT ); Tue, 16 Feb 2016 12:38:33 -0500 Received: by mail-wm0-f52.google.com with SMTP id c200so173915795wme.0; Tue, 16 Feb 2016 09:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:content-transfer-encoding:user-agent; bh=C84VxEK5BYSG5GjCKoVxS7FLwGdPOIzBLNuHBgFFGG8=; b=HWE7FHU7XgaqOJm8hG96hvHwwFg2czoM6NjyQfDJcDWIbxaoJ/1CnlFaDW1dHzxQ1J Zctu21A1brdphuQrnjVl+mxqFjc3cW74tRAd96gTwXuUOJ3lLuh5ChgOkOQkKa3ncKlF v1FSsnG1uCVFfVRKgc5hBlzcS5b65xQRogZRqAOnNpREcORX2lsTR2xwzj8BPLlyVs2P x/VaBoyioyMc9ap+vq0LHEd0W9T3niBdh+jtxPkiS/ziLFdUVtKjPCuUNoIQhxqoZaE3 6k4Nb9xGW7og2w39CFFeXxgt/fpNjtf3vpSuR5uriILr1f1fHvMXPkBuG99ybQTUJHp9 b8Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:content-transfer-encoding :user-agent; bh=C84VxEK5BYSG5GjCKoVxS7FLwGdPOIzBLNuHBgFFGG8=; b=LOcqRnZIBM76D/+PoSL3421434QEptV2UJ3N1GtvadugflfrSKHIq8nMmXGg+DXdFV 2zgCHQHYwDUOTN5GGzRZjaNJqLTViFcSz4jJUC8Xtsra2VUJDJutum+mPVeOL22NX39H QOsNIrPn560YJ220jyOdggn7/uag7AvHRs5FtdV8mcFcfwUgnrNtgZuc97Ro2a6ALftr Uf4DgXUQpmsD7Gm23BUfyJoN3sbUYiYK/CbYVDhTzV66mTpL8T93kj2I52CBpg9WpPOL FNbLy6Xz30AVbHGcVHwGPMnU/J4jkut6yn4vQWKH8axrzgEimFUO36dJGWo6KqmBIRq/ TBYw== X-Gm-Message-State: AG10YORU1ZvQK2P0G/V9qm07HHezHE0cTOUVBmbs+T+dUCxxEEcGeLvxxviy4AmYjphJVg== X-Received: by 10.28.125.77 with SMTP id y74mr19534101wmc.21.1455644311835; Tue, 16 Feb 2016 09:38:31 -0800 (PST) Received: from untxi.home (ARennes-658-1-198-126.w2-12.abo.wanadoo.fr. [2.12.63.126]) by smtp.googlemail.com with ESMTPSA id lh1sm30981715wjb.20.2016.02.16.09.38.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Feb 2016 09:38:31 -0800 (PST) Date: Tue, 16 Feb 2016 18:38:24 +0100 From: =?us-ascii?B?PT9VVEYtOD9xP0NsPUMzPUE5bWVudD0yMFZ1Y2hlbmVyPz0=?= To: Jiri Kosina Cc: Benjamin Tissoires , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH] HID: corsair: fix mapping of non-keyboard usages Message-ID: <20160216173824.GA23019@untxi.home> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_EXCESS_BASE64, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 This fixes a bug where the Volume Up key was ignored because it uses the same usage code as G18. Special Corsair usage codes are in the keyboard page, other pages should be left to the generic driver. Signed-off-by: Clément Vuchener Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-corsair.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c index 5855196..717704e 100644 --- a/drivers/hid/hid-corsair.c +++ b/drivers/hid/hid-corsair.c @@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev, { int gkey; + if ((usage->hid & HID_USAGE_PAGE) != HID_UP_KEYBOARD) + return 0; + gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE); if (gkey != 0) { hid_map_usage_clear(input, usage, bit, max, EV_KEY,