From nobody Thu Dec 18 08:37:09 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F090BC54EE9 for ; Fri, 2 Sep 2022 12:51:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237804AbiIBMvt (ORCPT ); Fri, 2 Sep 2022 08:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237797AbiIBMup (ORCPT ); Fri, 2 Sep 2022 08:50:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8134AF72D3; Fri, 2 Sep 2022 05:36:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1DCD621EB; Fri, 2 Sep 2022 12:36:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A83F9C433D6; Fri, 2 Sep 2022 12:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662122192; bh=qoyw/ywdNO6sZyo1tUQ3AoaTQwR0eePql9n0oiR6GcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VDPNtWriuPmqL7AyrtTMjCgP9fr6JMTp5hh203uN58mmRS2HK35Gxhis7+3Qr1q2i vIbeavnnGcXAo3MT7n2pwROL5TN78DzytsXGxP8a+NvWuyvvHTrIaVd7Uak1aL2sj+ NTSF1aL0N9qmU62sIwo0mBJBm9l+Of3jvRaErTBg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Kilmer , Jiri Kosina Subject: [PATCH 5.19 24/72] HID: asus: ROG NKey: Ignore portion of 0x5a report Date: Fri, 2 Sep 2022 14:19:00 +0200 Message-Id: <20220902121405.585759133@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121404.772492078@linuxfoundation.org> References: <20220902121404.772492078@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Josh Kilmer commit 1c0cc9d11c665020cbeb80e660fb8929164407f4 upstream. 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 Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-asus.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -1212,6 +1212,13 @@ static __u8 *asus_report_fixup(struct hi rdesc =3D new_rdesc; } =20 + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && + *rsize =3D=3D 331 && rdesc[190] =3D=3D 0x85 && rdesc[191] =3D=3D 0x5a && + rdesc[204] =3D=3D 0x95 && rdesc[205] =3D=3D 0x05) { + hid_info(hdev, "Fixing up Asus N-KEY keyb report descriptor\n"); + rdesc[205] =3D 0x01; + } + return rdesc; }