Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2432728rdh; Sun, 29 Oct 2023 16:28:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEf6VuDHqsfh1ljfkhLOOXQHiyJUfVUnDhIHbe3jyZomhNsZEGdk+i5/OR+ft3NE3mef9RS X-Received: by 2002:a17:902:c411:b0:1c5:bc83:557b with SMTP id k17-20020a170902c41100b001c5bc83557bmr7876008plk.51.1698622130523; Sun, 29 Oct 2023 16:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698622130; cv=none; d=google.com; s=arc-20160816; b=JKKlFTevSsfZaGxcbLoAhYy5V4L27R1DruOk4iaC+p+ydkyr0Y+sUvbsJEJdPN0qU0 h740nkGo/hFB2n3lTKxiD2ogLO0dH8B0mNwhNRNuYnRIUaKdi3zaF6AmfT7phU0r2pbD NttvLxikMJUymvc8R0Dn2uj4f7IiQAXWKq7UEpxBt1y1PPQuf+z92/FTRaSUSeJS1z5j D0VnbIAAvzQkPO1JPqHIYJ4euY3tNFxnm0FeI4Q++za6mKGv7adMGTU4MdvPNqzqLxqA +ytWkPYvZHFTScWcRyJ71G4QozleabtCN3ptLhAQAje3avirnpkN0GIgSmsNwGsJi8Xc aS3g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RlYsuhap3HdoJurirrweAxdzvWNkcDpLBstjs/SyBq8=; fh=DPEQvgNsI0ljw1vxU2TXL/TKtYzbGAVIPwDBQaK8mQM=; b=xOvMV/iQ+bdTwJo9rbYEvwXwEPXpMnsxZ+JN/4Oz0UzYTDesTFwPElv01wnBSQ7cHo rd/h3YbC2bolWGsVdgQpePwZaUuE5XkKxxY/7W2y+q8wSlOz+wqlBq31gxzhi6oyRRdA C+ApfyPEPD33oFpptsl1kqA0l5X49UDfCCb2aTkxLudKgcnFTQo/OG+5UoCSG5XNVPMs 7DUbZSUy8JB8AShxwcskd0zdazIGvVcNgT5fEWbhF2bElLCPmKZ/pl++nutDkN/MSL/n EaQjU0WLTk0MjqSTU760RYtXcwGjPsDsZpzUvSnEh183D9YdQD9IXN75fI0otolpdkQH En0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FVrHYJ5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a16-20020a170902ecd000b001c3b4eb2135si4292820plh.463.2023.10.29.16.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 16:28:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FVrHYJ5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CC5E6805362B; Sun, 29 Oct 2023 16:28:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231887AbjJ2X21 (ORCPT + 99 others); Sun, 29 Oct 2023 19:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232107AbjJ2X2I (ORCPT ); Sun, 29 Oct 2023 19:28:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13AE53A97; Sun, 29 Oct 2023 15:57:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EB78C433BA; Sun, 29 Oct 2023 22:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620210; bh=+fquCF2L/2oZkAaBOfHHvRsQJQ6bsGAbQLrcRdEpmqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FVrHYJ5ndc3hj9IVybMvgIvmZoD4KGUsQ6jzpZ1HzJUfUTgnjJcuOWRYWXt9CwRxG PV2YPWUsoibXiN8/MO3eUX4/O6hUD5rtBtwaVEx8nAHTtcHyQFZBXn8WWclClHrcjt vjj6nzHjVdDmm31M7Gu3d8vJKxQE2hpG1isJlpILjdtD4GILnB/iejJZKJ1uqloERY SUkY6BGD9hxr0DSTR7P6BptJnGwCGdBeU3WyrYYEC4FNFAz5HSrvi3fDk0ZY/KsqlU jhYozaWL4fyZER4hDh4tAyE2P4swIppU2TV4L0OGEakYggCsBKnHeVxLnqfa4F7OVb /r89RKwCV+fGw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , James John , Sasha Levin , ilpo.jarvinen@linux.intel.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH AUTOSEL 6.5 44/52] platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e Date: Sun, 29 Oct 2023 18:53:31 -0400 Message-ID: <20231029225441.789781-44-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 29 Oct 2023 16:28:43 -0700 (PDT) From: Hans de Goede [ Upstream commit f37cc2fc277b371fc491890afb7d8a26e36bb3a1 ] Older Asus laptops change the backlight level themselves and then send WMI events with different codes for different backlight levels. The asus-wmi.c code maps the entire range of codes reported on brightness down keypresses to an internal ASUS_WMI_BRN_DOWN code: define NOTIFY_BRNUP_MIN 0x11 define NOTIFY_BRNUP_MAX 0x1f define NOTIFY_BRNDOWN_MIN 0x20 define NOTIFY_BRNDOWN_MAX 0x2e if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX) code = ASUS_WMI_BRN_UP; else if (code >= NOTIFY_BRNDOWN_MIN && code <= NOTIFY_BRNDOWN_MAX) code = ASUS_WMI_BRN_DOWN; Before this commit all the NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX aka 0x20 - 0x2e events were mapped to 0x20. This mapping is causing issues on new laptop models which actually send 0x2b events for printscreen presses and 0x2c events for capslock presses, which get translated into spurious brightness-down presses. The plan is disable the 0x11-0x2e special mapping on laptops where asus-wmi does not register a backlight-device to avoid the spurious brightness-down keypresses. New laptops always send 0x2e for brightness-down presses, change the special internal ASUS_WMI_BRN_DOWN value from 0x20 to 0x2e to match this in preparation for fixing the spurious brightness-down presses. This change does not have any functional impact since all of 0x20 - 0x2e is mapped to ASUS_WMI_BRN_DOWN first and only then checked against the keymap code and the new 0x2e value is still in the 0x20 - 0x2e range. Reported-by: James John Closes: https://lore.kernel.org/platform-driver-x86/a2c441fe-457e-44cf-a146-0ecd86b037cf@donjajo.com/ Closes: https://bbs.archlinux.org/viewtopic.php?pid=2123716 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231017090725.38163-2-hdegoede@redhat.com Signed-off-by: Sasha Levin --- drivers/platform/x86/asus-wmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h index a478ebfd34dfa..fc41d1b1bb7f8 100644 --- a/drivers/platform/x86/asus-wmi.h +++ b/drivers/platform/x86/asus-wmi.h @@ -18,7 +18,7 @@ #include #define ASUS_WMI_KEY_IGNORE (-1) -#define ASUS_WMI_BRN_DOWN 0x20 +#define ASUS_WMI_BRN_DOWN 0x2e #define ASUS_WMI_BRN_UP 0x2f struct module; -- 2.42.0