Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp989617pxp; Wed, 16 Mar 2022 23:39:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxw0UXGs0z+kQDi7/8R6sgbvubdJc0cBRd5ajKvkhYkb+JuTK1VokeI9x4RYfimohIYjxWz X-Received: by 2002:a63:2b48:0:b0:365:2766:7e5f with SMTP id r69-20020a632b48000000b0036527667e5fmr2508758pgr.613.1647499163549; Wed, 16 Mar 2022 23:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647499163; cv=none; d=google.com; s=arc-20160816; b=NUyD6LATupPI2xkYKwog+kLhDNRUEwb9ySjkH86Yda1PyKGM2m3wh2NRFpeGe5fbF0 0XpaolHMpWzQdyFlXKjf8JutstreCIAZ7imKB/3A7cXP07NJ7OjvAjrkzyIB3+kLNOzb pfr97UNJXypcTyW1qLi8Thb49yhEwf8KnGWVzpyb5BRFoVdjZoDFkM0TDOmgJOM4snSB cNyHdtYglXrDyE5KIgchyQue3ypdlw31snoZii+oWour0suOjVzsDzvFblPh0avfNSTT wmJAX0P9VAC2NEoCB2sQWmLr8sd2AnFJgh5GurCZXrUr039xYzASbcOkYOqkkixa9cae Nghw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=NnlFNsg5jkf0JsAgMwSQZVO9GjEPit61Z1QWDLThAzE=; b=b3hSdHJ1IJIZGPKJeYpQt8s6E8TWG3KK3ycy7fC2XZqR8jnGYr+My+BAijfaWc4jh1 W26xRi88THzMVMkcNTakHtMoghlFEn4sBhMR7Gq7KAr5ZIw3HzEjv1H0eiJtQjtWQc6I mbCcloOOAFvhUrdS5bhFVLrskmQf86muqVk0T0FhX/rTIqNBHSUfcgY5RjYcuMIzS2sg WgMzifMeUPlqn3TSeGbr4EnHbVx8V/Mn4Bmv7x4c/vh7c1rJ99klkumVMLkH7gretxCS ssww+faEBzRoWIegwHLINblFJyobYjaSdAO/oWTq3gnWDguURryc9vPBtrJmC3XBmv0p mU1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fYUqM6CJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id gi21-20020a17090b111500b001bd4aa6bd2esi6945932pjb.80.2022.03.16.23.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:39:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fYUqM6CJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D18922C4905; Wed, 16 Mar 2022 22:25:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242923AbiCNQRM (ORCPT + 99 others); Mon, 14 Mar 2022 12:17:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234683AbiCNQRK (ORCPT ); Mon, 14 Mar 2022 12:17:10 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B62403EB; Mon, 14 Mar 2022 09:15:59 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id d64so17661242vsd.12; Mon, 14 Mar 2022 09:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=NnlFNsg5jkf0JsAgMwSQZVO9GjEPit61Z1QWDLThAzE=; b=fYUqM6CJFAFX9w4Y37xWWlbZmfgm5Cf8oDC9yL03HZ7+KyyOSvcLRhwlU+kxxqxud+ K5LMZZerXToo7xsqX96ED9VOoIZcZTFQ2ZnHc9ko/bTLxG6lU2BXCf3LLvG6JSj5FlVh 4k0K/iJn3cpnPfF/+Yx0z3yRkKKOBSdsNHgFEOyNRsA+JNuaP/ijAqNB0OlEI5YxP5pE YdIJYT01DTdoFSf5anRuPZU9/LsM4kT6m3+6aSSiZe5TRNLyAxBCBTBtT1/W9iFJ/KKt 6hoj1FvkJEbUcr+Nmic/CtpS/5/ZvuO6NAoTXxq+CZqbjkQMs9vP2aZdYNxMydsZchX4 MWjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=NnlFNsg5jkf0JsAgMwSQZVO9GjEPit61Z1QWDLThAzE=; b=C6jvKi+MCRLg8Vjf5EdUcFa7teoppRUkztmSMT9AiVW9hz3QceXYuJIxnqkmQtHcCG Gb0yePrywKpQZKTYGGcrbblfbNTnCq/+znLsi/se8eaVPlrvM2EoQSFny3Mpwkj8wv2o /I7mnsMmVEnIiwBy1HBV4wdME5fNln1a9+bN6PL7sjM5+tzNx9QIpfnZvCu6tMtA2kSL ACGQrcs//aPPU4K8we0NqWGQZPVaBssb0XqxnGzwwtJuxtAOT6DybsES5F6TUOatHRXS 6A4xL6Lr5ML+qSQFoK8oNS6JfD9ndFUryiJt6KBWgAoO8dahopOg/gKvaeBXOjcAzlR6 CZiQ== X-Gm-Message-State: AOAM530N2ElZET+HWzREgtFGk01tGaNFivBuR4qEva+k4vBNgWYh9hZr KGQEiTRPqvYNKSy5oLJUaXCTBk7IckVUL2XEmq9dQ621tWOJ2A== X-Received: by 2002:a05:6102:32c8:b0:322:b329:bda9 with SMTP id o8-20020a05610232c800b00322b329bda9mr8270400vss.83.1647274558487; Mon, 14 Mar 2022 09:15:58 -0700 (PDT) MIME-Version: 1.0 From: Josh Kilmer Date: Mon, 14 Mar 2022 11:15:50 -0500 Message-ID: Subject: [PATCH] hid: asus: ROG NKey: Ignore portion of 0x5a report To: linux-kernel@vger.kernel.org Cc: linux-input@vger.kernel.org, Jiri Kosina , Benjamin Tissoires , Josh Kilmer Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On an Asus G513QY, of the 5 bytes in a 0x5a report, only the first byte is a meaningful keycode. The other bytes are zeroed out or hold garbage from the last packet sent to the keyboard. This patch fixes up the report descriptor for this event so that the general hid code will only process 1 byte for keycodes, avoiding spurious key events and unmapped Asus vendor usagepage code warnings. Signed-off-by: Josh Kilmer --- drivers/hid/hid-asus.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 08c9a9a60ae4..73fb9fc0701c 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -1212,6 +1212,14 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, rdesc = new_rdesc; } + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && + *rsize == 331 && rdesc[190] == 0x85 && rdesc[191] == 0x5a && + rdesc[204] == 0x95 && rdesc[205] == 0x05) { + hid_info(hdev, "Fixing up Asus N-KEY keyb report descriptor\n"); + // On the 0x5A input report, change count from 5 to 1 + rdesc[205] = 0x01; + } + return rdesc; } -- 2.35.1