From nobody Sat Apr 11 11:09:12 2026 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 2957FC19F2D for ; Sat, 13 Aug 2022 09:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238972AbiHMJhE (ORCPT ); Sat, 13 Aug 2022 05:37:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238925AbiHMJhA (ORCPT ); Sat, 13 Aug 2022 05:37:00 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8697C41D02; Sat, 13 Aug 2022 02:36:59 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 9F2693200904; Sat, 13 Aug 2022 05:36:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 13 Aug 2022 05:36:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1660383418; x=1660469818; bh=5s JrxwyxQvWKQb1bzW9egtWpG8+alHMEb9LZTo1uBPM=; b=lXvEN5Y/8LS7q/FLxs 5RNfGI5/dmIWehRPMH9uU17gibgK2ZFsQB6DYMHNBNjIyzQPniY/noYgBgjsMkJW pA8VMDgYp4igaA8PQy2EzwSiJql682Iq1W1e1Bl2bTeWLzqYMX4NNZ6tQXhsS2h6 Uvv52ABEowvZldqGS5wE1TMkK8ZTWgQRVlWUR4DzXx34YNPxIEK2YZOVAFO9vzaE R6QGJ40amdcjveJ/PhxndgZJspWDDw4k/Wd3HwPsK7GLqSi0fORLhPsta62gxu8Z jS9/0XwTigFAl27MOAv6YMSOghcQjkG7aahRqI6pu4SzJn6owe4clGjBzwrWW7+2 77iQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1660383418; x=1660469818; bh=5sJrxwyxQvWKQ b1bzW9egtWpG8+alHMEb9LZTo1uBPM=; b=Co0hk6ZWO47495/f1cRQrytV2lKbM Xi4SrCbNFPP/uqVyDXq2Yf3BaI9LwVyB79QVkmZ5Q+6t8V8CXH8Wc0mfc8uTBnhe ipOVSYAnVn5MmonUDguGoJsrFlNh7OG4T6kbce77yvUkYJPgrx/EL8ga1GdLiziO HCibZFwS3tzyZ80Kd0YBXYQUWFP9EvYCUHQi5inWD+L28r0JKsicUNJQLn03UWHC UV9J4hLsdZ6q+YnehutqxDVRNKenqZsTD6zUNDRSyaqA6odOlRw5LFMozxshNkBs UTY/yfLXFCtP/Tv44Hx4hW456GwoF/HayIxpsftHRObFr4B/6kSlh6WCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdegkedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 13 Aug 2022 05:36:55 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v2 1/2] asus-wmi: Modify behaviour of Fn+F5 fan key Date: Sat, 13 Aug 2022 21:36:41 +1200 Message-Id: <20220813093642.7440-2-luke@ljones.dev> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220813093642.7440-1-luke@ljones.dev> References: <20220813093642.7440-1-luke@ljones.dev> 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" Some more recent TUF laptops have both fan_boost and thermal_throttle. The key code for Fn+F5 is also different and unmapped. This patch adjusts the asus_wmi_handle_event_code() match to match for both 0x99 and 0xAE, and run both mode switch functions for fan_boost and/or thermal_throttle if either are available. It is required that both are tried, as in some instances the ACPI set-method for one may not have any code body within it even though it was returned as supported by the get method. Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-nb-wmi.c | 1 + drivers/platform/x86/asus-wmi.c | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus= -nb-wmi.c index d4cc6afc1861..c0a0d3f1db3e 100644 --- a/drivers/platform/x86/asus-nb-wmi.c +++ b/drivers/platform/x86/asus-nb-wmi.c @@ -584,6 +584,7 @@ static const struct key_entry asus_nb_wmi_keymap[] =3D { { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */ { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */ { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI = */ + { KE_KEY, 0xAE, { KEY_FN_F5 } }, /* Fn+F5 fan mode on 2020+ */ { KE_KEY, 0xB5, { KEY_CALC } }, { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index c62977cd07bf..04699dd72f1b 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -3104,14 +3104,13 @@ static void asus_wmi_handle_event_code(int code, st= ruct asus_wmi *asus) break; } =20 - if (asus->fan_boost_mode_available && code =3D=3D NOTIFY_KBD_FBM) { - fan_boost_mode_switch_next(asus); + if (code =3D=3D NOTIFY_KBD_FBM || code =3D=3D NOTIFY_KBD_TTP) { + if (asus->fan_boost_mode_available) + fan_boost_mode_switch_next(asus); + if (asus->throttle_thermal_policy_available) + throttle_thermal_policy_switch_next(asus); return; - } =20 - if (asus->throttle_thermal_policy_available && code =3D=3D NOTIFY_KBD_TTP= ) { - throttle_thermal_policy_switch_next(asus); - return; } =20 if (is_display_toggle(code) && asus->driver->quirks->no_display_toggle) --=20 2.37.1