Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1962317rwe; Fri, 2 Sep 2022 06:39:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR4P7Z85qFIaw8wNsQjCGZru1WCdMPrWOyZjLLydiZj57sNWAdnRBOLjR672RaVHLDo2kPDj X-Received: by 2002:a17:902:e5c7:b0:174:e71e:30ef with SMTP id u7-20020a170902e5c700b00174e71e30efmr21386601plf.30.1662125992780; Fri, 02 Sep 2022 06:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662125992; cv=none; d=google.com; s=arc-20160816; b=d/CzaA6pkbRvHLnRif2P3JRwrly8VAplzk1eLqy/uHTBVRL5FnqAy35sPydQahARjQ YcIXS7gCJO0nHDdCwJgYGJgsaJCf3IlNJtl2TQLbVLioO0EeI/Ry0tnfnwGt4Ei8GcTm jAC615agrJ1SC+X8Gez5liGMWDEBk9/pIz4UcLHj4xme/jdokMwt5P5CFoc4zj6Qeo6W P+/4i/eTNKMYmLZwBKuOX2bE49iVHjBYAzXqaQa8R5R1QsnNe/nJOKoCIl95/SV20Ggj YjqdDM9Oyuff0Tty9CLQy6JDOzfjvkaFFYCczXdmDb2LKUdzsOXW09uDdhfep1YebLMM nVdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O+8T1oCRRu5jty00usXV/npmQKbLKbzaO7yi1/7W2g0=; b=LifRUobwV6h7gucy0LZJrNzpoxW2CWTn7r/CNvzMV3aCSPF/8F56xwI4zUYN3D9U2T NCJaxlyyJ74pu52Wlxgr6kYLwLVQZihSe/zbiAAGN5NlPhjZ3urLl41AXe8q5gGpSU4K OJbioERJQVeDB9Khs8YrDKj2HxuKjU3pe46ppiTxa8l1FfI7V5o5abykS3q4waU/naxN uNVXUuZRQ4kL/WP5JYLiGUtfzDkCyT09mavo8acbnasbr2+UbAwd/zeRGoH9QqR5ghKC leZRxMjpI4ju/n8FLVS1criiDzrvUHGql/SVwH0J7GCSQAxaYxNhtWQegdyhF8gC65LX 2kbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VDPNtWri; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f184-20020a636ac1000000b004301e6b2eb4si1778859pgc.604.2022.09.02.06.39.39; Fri, 02 Sep 2022 06:39:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VDPNtWri; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237710AbiIBMvr (ORCPT + 99 others); Fri, 2 Sep 2022 08:51:47 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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 = 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"); + rdesc[205] = 0x01; + } + return rdesc; }