From patchwork Sun Nov 24 17:14:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13884167 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32203433AB; Sun, 24 Nov 2024 17:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468486; cv=none; b=cXz2+K2AvLPrF9O1vh/CBqXilxZrhgTVG5EEeubKMaCG3ImRfaPWrzaCl2Lo564V+Xom3C1AcS300vwNuWM7jkdSWJ70bV4PCZlHeR87Usg1Ncqk0V1+1FbGO/hKDoZHhkblgm9YrM4efEIdcOvG6fK+2TxgsZaeAw40iXtppWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468486; c=relaxed/simple; bh=bvFbxc5P++9Gag+zgAYbv6WxVb4HNe8omEWI00cWw4M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r4RGydWVtSsnnGDR4Zua5ctW0fOtvE0Xye5VH8pnkK8AWTsayZXg2Qf14Ovnx/8RjMzjOudfcfFfbmDMiOdxbG3pXiNhk1TsX2dD4XK/dlalm6CKi147P5FaFRbgyJJBtYAkWdQ/giTbQnnDX1xkfzGXXk978Lq/yp4jPNhN6TA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=YcoqaQaY; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="YcoqaQaY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1732468476; x=1733073276; i=w_armin@gmx.de; bh=LDc/EFycTFB282lPDii06kaNXf50E69nOVsxqUvjg/Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=YcoqaQaYjYJH2vVFFHV2/YSPItT1Sdji+CGumitPuTRrrmekDRyhLTrI5AfII8KD RvjJw90nl3+d0R50nEpVNR1V1o+VtOv67h0QztmCvIBFZjz1EwpZ2ygdVbnU3uxkI UCnKCEF+TKk11F1JZ0IGQFAsViqUGLTSky9hKnAZz2H/RB0Q5vc5tgpUDCZhrU2FR yErq15IP0WxcHLtOWmNZPDg0XyTKCngPTdO+jAaCbNtho8NOK9PxxZX8t9ySoAJ+C M+WzauaNeCX6DABd3yX+XWK0zlBOQ4pwo2L4emMqmZH21V+M6WEW0dHsMfFDVyTRj GiOZEyeipov4jKRmvg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([141.30.226.119]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MnJhO-1tyWYi0sNw-00ZNgg; Sun, 24 Nov 2024 18:14:36 +0100 From: Armin Wolf To: jlee@suse.com, farhan.anwar8@gmail.com, rayanmargham4@gmail.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/5] platform/x86: acer-wmi: Add support for Acer PH14-51 Date: Sun, 24 Nov 2024 18:14:22 +0100 Message-Id: <20241124171426.29203-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241124171426.29203-1-W_Armin@gmx.de> References: <20241124171426.29203-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:CBcrTuApz/JANqavvS4F0vLgZMUsKTlWwPe68Z0SpBAXF2esHL9 weVlgbO4z6raUom/2AgHsSv9pyGtPJMYIOTr0kg+02PY7q9PMneY18w2ndBQDl2gu3v+/A/ d/LoM3MYBcpnRaVuxzwKgLkp9Zs1GBdL5QBE7C5PcFExRdtFgdbdf7STGEK9NK7Z8x5draM d+lV+EzHGOzQ9rVtxwAbw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:pr5Di7ziNNs=;4hmEoIP3jVLVINGfEFgPtWvNkUS fP1hGV9SRpJHzPt1BIY8SMcnt2wo/cYS63daEZZe4Z29c3Txh3rfYjz2MiD7rqIan/cPilUF9 83jMoK82wrum22NQ/0ouhNbkO5EBJjsNwKz8UQYc5XaWgG1v+T9IWL8eRzlWLlSfhSL24cT2q Aw2KYKjLcICNhwOrSm1jvaRZw8FwhRc8Sa4dWIUogpYEWrovkWmzOzS3rTzDWWB6Zx4rW5037 nJL9hQK5pp+/FD+3Oehw4YzPXXNCRPWZFgLPSQx9v48TP8l8GSvePs/xZRf9n3be1OJBy7rPr w+Idb7iCNv5VjaQuUQZPy4GkzCMe6N2bfn76rfIqUwJKUklQBFL2cGuW1olrdORAjcharb/yn Q34ClxfMmMtHs6CLSNJopaq2UmlCcXI4PaLililwAMeJJc6S4I//3y4XIrSdt9OeN8qZ5j7nH 19lN/hOEva9YS1/HLtlWvEEp6+iyKfQSQcC8INus9KBUbdJ20dQ3xDW3Db+ZH6517xwlT5YnV gh0zMldW1dDdjZL0Uk/i3X6g42TkpvBleNa99FSjWN5MXkx1JW7RX6USDsZW6ocs8uWBpmOoj BXc7AXCUsoElyrYRdIRLUoR2uqdgB/u/gb4udWaw0zzoJvOF1GxOqFg2AGZttZlFmfG8eocO2 pBPi/AfgymIO68ch441ZNhvzpbuGGvpXvDLpE9TJGmSlxPPHInCsChqZ/+Y/ovaOJw1wi4jq0 4vCyp+BKf45AHSnoLbx12uupXKF/D3hT2DVD8Pryf2PYtYCCH31Z7JmKUqaSWrfC8F5U6/WCc NMoWaUs+WGC3pRK7DBukyfS/zF/AlmaNTCXQNq7iTwcgCdwyfOwU2ceQGX1IbU1UFkp2GskTp 3ye7pm5kZDhHVlYxsZMX4G1ZyTuwLCneZvVSOSeJQMLCdQsTe9+wAttBgmmiXZ4T9Y806ynr7 VtEMW2aSiDefOnLkO43iSkeYC6OiVN90FK0DNIzNZDS9IOASCELLoutFpdVppD03Ih0nWUGPs m/l98Uo9Y5KAVr/Q23TnU/C6qtZaGm0+YiiKctxwlH1beCDBnKo10og2eyILfz3I1EL2jQU8K wTJHNc+KyYa43Uw1SUSIEMR0NyjeRH Add the Acer Predator PT14-51 to acer_quirks to provide support for the turbo button and predator_v4 hwmon interface. Reported-by: Rayan Margham Closes: https://lore.kernel.org/platform-driver-x86/CACzB==6tUsCnr5musVMz-EymjTUCJfNtKzhMFYqMRU_h=kydXA@mail.gmail.com Signed-off-by: Armin Wolf --- drivers/platform/x86/acer-wmi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.39.5 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index d09baa3d3d90..5cff538ee67f 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -393,6 +393,13 @@ static struct quirk_entry quirk_acer_predator_ph315_53 = { .gpu_fans = 1, }; +static struct quirk_entry quirk_acer_predator_pt14_51 = { + .turbo = 1, + .cpu_fans = 1, + .gpu_fans = 1, + .predator_v4 = 1, +}; + static struct quirk_entry quirk_acer_predator_v4 = { .predator_v4 = 1, }; @@ -600,6 +607,15 @@ static const struct dmi_system_id acer_quirks[] __initconst = { }, .driver_data = &quirk_acer_predator_v4, }, + { + .callback = dmi_matched, + .ident = "Acer Predator PT14-51", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Predator PT14-51"), + }, + .driver_data = &quirk_acer_predator_pt14_51, + }, { .callback = set_force_caps, .ident = "Acer Aspire Switch 10E SW3-016", From patchwork Sun Nov 24 17:14:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13884168 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1424771747; Sun, 24 Nov 2024 17:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468489; cv=none; b=TeHFGtaQp2oKiUZoUh8E5336SwE0rFHuKCQuv1jdhg+I6Ztc6Ya7unY11hv++6Dts7TrEa2o92YjaxvlUBajXOT5mW1ZAN5bn/MgCRthenL19f8cDrV0IsunnGhG5YyJXubwormEeoN1iJS20QiurkDy6X+3hjEb3i98tIl8rJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468489; c=relaxed/simple; bh=Oe3JyZEwWHQ5DGyvSoDFsVx4anO3uKPtSPYDS60LLlg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DeXP+MfWZuJSZNZyedcNdQe6MJkif80qMMebBFnZyK46O4pS4CRUMvqXSmCTTA/HbcG2oJPial5yJhZI7u6c3YHO5QdDaYIFu5360WXhsWoRWTG77UxQFviwmNKGoErEnohhK7NMB/eF0T8g/OWpIMT7a+4ZTMzoTQLgFZQ4OS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=AWbPcabD; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="AWbPcabD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1732468479; x=1733073279; i=w_armin@gmx.de; bh=AgoyI1cc5qKANNY07ndy0SF1vtFAblDEsqsKxaRPzj4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=AWbPcabD+bOaRSJlxdi0P6XDT8YZieisSy2OVvoDm+xeQbqtccLenz4H3pab2cNb iBt8Ahiho9mE7NrwELRj0BDtHaOHhn0pK/WmVFf1Aoo7cKisTUQrb+MDNU29grWDQ s1RUEJ5vpxUnRpfihG5dnOyC6/uunIs5ofdd6VUA6PmskRbCzFdqaA7mnHiwOzOVF pqMVzhG3yvUsPps3JG6GH9KNvPzvDjDXKLaezPOCtSk536mxkRkQFlcxxDaqnSaLF nQt6qeupAbl8Tv8AsYK0WXvgb1Ix1/bU0WpedfWlcgCC4q1WIp6m0bIls3lmPg+49 87iaeFna1W9caXOGxw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([141.30.226.119]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTiPv-1t9RH00Ibl-00Q8rK; Sun, 24 Nov 2024 18:14:39 +0100 From: Armin Wolf To: jlee@suse.com, farhan.anwar8@gmail.com, rayanmargham4@gmail.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/5] platform/x86: acer-wmi: Rename ACER_CAP_FAN_SPEED_READ Date: Sun, 24 Nov 2024 18:14:23 +0100 Message-Id: <20241124171426.29203-3-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241124171426.29203-1-W_Armin@gmx.de> References: <20241124171426.29203-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:tRFbj9ZaUSraNy5SHBawwgI/kUz3KKdzJ5EFzjMHlsZDx72TVQr UlZStcvmYzrWkpk9q3RQHrSAVfLc6VxkGLdYHIJM0zoh+GGJ7VsqRupr1YWMn/WzGX+iHhc 5Az8q2ELt0DKoN/oDwKpTFLsRcUU77rvUSeUbfzsbAtAalbHoaA9zO5vfcd1vYNRliMXTQM alghugKs6OtlGN+/Jd9yQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:i6QfNh8cN98=;0aWETE3+yHbTs1o3pm0V55Ur/wz qAAZWsbati1i6d+WyVsRMHNfnSTxW5QC3SlokXRhhNpGQ/YhWll/Mp+K4NcehcFgY/iWVvo/3 CbTwhlQ3nLStLx3rCsD07guBXj2/bnze+TQLLxd8SEDjie1fFvDllaIqnl3gYfXlb1LCEMSbD fw1fWEM32tWjotH4HJdMc1RZimEe/JqsSyGtpcKwNMP6eYnY+Rtw8SeyYSXh7k2F3f3lO3kPw 0p/wT5LsqHq7POysRW0miz0sj+6/Xm35griSlUNDEfy3nJQrrgPp4hTHm6ZyltwG25yzaPxvg rd8zpQZrBI7rqD5nvYn/gxSIbVM1fUukpr7LFG3Cc98Be85Gg6x1YocmcUvBWtu3xrfao2EwR 3Su9fogyOivGplH8PUvMafblEcvPMxU8nn7/s1iMY/rVac0jAiZzNwlije5Yjd4nicnecCHLh E7zCIZuXLmcolBAY4XVqBGPQP8SfCCbubHGZrs872dp03ty2rGcp//ItsoteVO6+xLTq4WM5o doyvj84ufsA2Z8TSjFuuJTd7gTylaOu5KBFiGScT0fjbdqaGaILlbHBqJ0xAgUgekXTU7uESy 1mEuaXW8zq7xZ9C76gkusKRm6RlyaiPr4iLGtnEh/e18yys2DbZLrtVZTib4/vCFBNSRjqevc wFRDfhEvmtOPIaMr4ZEpX3qIxNtWEmHMDpPcbjPFJXMGw2mkLh/tVFmLH9L+JVzv+TFJh2W1M ADW2vhDKMnc5qlllTPk/VAuffO+GXKCO2rTlMvKWjcZ5SoiPU21Q2P11fVO9UrHJ5OimmAV8P R/z3OaNfsM3qIshqKWKOcMGX7pt3BY28UCkbAFR/Mc8uUGtz/D3PEIRB/PsYrekOn/zoowjVT 2stVy9qlWuXqKRJTnE44XrB1goyDgb4k4/WECQQwL3TWhwhrcpvbdv61mHR2uKmJsuKMUKZR+ eJcFAHaqkCyOaktv3dMO7IyGV3KlqtzyAvDeMpulLjPOsgKq5YtQFEww4NVHRQf+7vY8KTLpc BKo0kFuHo2j853iGowfp58DZuqZyNgCC//SwTdTz4kYEO0zAAXu08Zd3SbSEcfXhsu1UAsuix JSpamwZ8Vk0rsdqDZil33udPhVWdx0 Rename ACER_CAP_FAN_SPEED_READ to ACER_CAP_HWMON to prepare for upcomming changes in the hwmon handling code. Signed-off-by: Armin Wolf --- drivers/platform/x86/acer-wmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.39.5 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 5cff538ee67f..dd57787466b9 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -246,7 +246,7 @@ struct hotkey_function_type_aa { #define ACER_CAP_TURBO_LED BIT(8) #define ACER_CAP_TURBO_FAN BIT(9) #define ACER_CAP_PLATFORM_PROFILE BIT(10) -#define ACER_CAP_FAN_SPEED_READ BIT(11) +#define ACER_CAP_HWMON BIT(11) /* * Interface type flags @@ -358,7 +358,7 @@ static void __init set_quirks(void) if (quirks->predator_v4) interface->capability |= ACER_CAP_PLATFORM_PROFILE | - ACER_CAP_FAN_SPEED_READ; + ACER_CAP_HWMON; } static int __init dmi_matched(const struct dmi_system_id *dmi) @@ -2551,7 +2551,7 @@ static int acer_platform_probe(struct platform_device *device) goto error_platform_profile; } - if (has_cap(ACER_CAP_FAN_SPEED_READ)) { + if (has_cap(ACER_CAP_HWMON)) { err = acer_wmi_hwmon_init(); if (err) goto error_hwmon; From patchwork Sun Nov 24 17:14:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13884169 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCE8F12B17C; Sun, 24 Nov 2024 17:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468491; cv=none; b=AmDPk8+OuJ/csGR3ckCA7ZNuoZS/V8EW+CUrXQ++lTTLEOucjC+pTo8QIi+PzjQmEBsGkloKEJNBYsAPULo9tQ7fhq4KwUA3ckvBuQs0SUNW4Tl9+tA9sdFUbqHo2dtlmzDsxtBoMZN0I1din/HjsbNqCjb04WMPHqv7BhCYlB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468491; c=relaxed/simple; bh=TT8O367oCxl+F9JDDZIY5YxynYWK+Rsj6R4XZJXRhqE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=I8i41ZekH1CZ/Vxc3JEFkbD3/cI7umpDgTLwCQex7Rr5koLltuhmI+iFJ6ZVDXUqz6TPAnYNh4xM4AwHB7nt4wKuOKz8gJQToEgz4O+dsNm4OJHjKHwQ3jfbzpC0ifgzSWADarBjV7UxWJ1PU6rfxaI/V8bGEuJmfMOJN4b1cGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=i1Ws1c8g; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="i1Ws1c8g" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1732468481; x=1733073281; i=w_armin@gmx.de; bh=fZmHkIMIUdIfMfagPjZfZST1MIYYT0drmmDKyN+Uvz8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=i1Ws1c8gSKMD3EUuOyJ69c6//V6sKgxRLQrec3W6B3m5c5cQ9KlQYog+ye9rFeUg lcgWSNgWZLmkIy2FJhGzDrtvJzfTJZus9rDFBrN0GAlHUBP43cmySqOWyEUjHZAbU XJ9MAIKe9La8Uu57tS+orPTzE1yd2SA+uCAk+VUUiN9NSWqb0yfzagBUrOH3pktgt +rrH4hhuZQbsou28mJfophIe1tf1pEVDWlpX8m72pL9egWiHIDNlHeq3IpD7FRkwM Gpplc+AYldXS6SQkON3tqnzp06m/oBWJmMBBw1BxdmDOUrJoeDHB2hqw8nfsBCBJy 3X0QnrJBR+dvmLFQBg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([141.30.226.119]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mr9Fs-1u2M8V1nGQ-00aVrz; Sun, 24 Nov 2024 18:14:41 +0100 From: Armin Wolf To: jlee@suse.com, farhan.anwar8@gmail.com, rayanmargham4@gmail.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/5] platform/x86: acer-wmi: Add support for temperature sensors Date: Sun, 24 Nov 2024 18:14:24 +0100 Message-Id: <20241124171426.29203-4-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241124171426.29203-1-W_Armin@gmx.de> References: <20241124171426.29203-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:/uxuGI9SYPfiDM+uFre+uNU/7AhCYnzlumWZ/QzakRZFqQrBgvt chCIdDTM5P2253AIImhvVmYVEtcpFesZVv4s+0X/pO+4ezVGRCThvi33U1+2TxFhJxN2ZCN /b8BU56kq7hZ+2jXOXhp6m1XMwFMesKfr3kAXK+6nCb2z2jHNPWyTJOECrqs1eB1tEWvcRV SnQ6M+eVyVD/SbzSLwzyg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:+8o/+kLHqTI=;T1KZhB+W6XlLw2M7t01rN3e7Xe9 B7pXmmyf9t0w4sipOHQ7foAFkFGnmyzrmhuNERo4I0KSMOhHB5Jw8ZpvpMYvoZzKuaX6LukvX KXeahsMjM6CpFt0dl+ee3sLgSksggWaHzHJemaGzRUoH5sgKf34mfM9i84BD82OhNee7QNiCP LvR/kq1LViDa+eqzkZdo1jBq2qvfmMegCZfrwxQIeDjusjiagU9VkyEvi9IAkf6WWpfsIMM3k J2/2VBBLjYs0ARaJTyv2b+qDbfSgroOfY5bYAPcj+hyvV3tp6FHed74JIr3HOPaZjRBeDuvbi KHkHPYyar6pZWioeyyzJbLTSAI3HeG2kTXV3S7oEgZGxdrolPA7LE9FjD76OfkFf+wUnpqE9K voMTiL9pZf5geAraHkIxr1R0M1120YtvaidtUo1/gaAPjkifCnMjlMvfx1aV/sQNpYF1fldZO ADsjh44EsXGWckEB4JEhUqV2U6Gng6ZfZZnUOKEoj1ygvq4ESYPSxISZ5djD1Pj7vLvq13pK+ Mjhdjcx+wbl9y4Sc7g8dsMHHqRlLN2fId4swP8kqKsgjuylTGADpSW50MymNM8fLpWcmCryI+ Tsk4Lw3txeGCu3TJHxQNHjhPJdkv4wO1JTWb0jz3heE+ldiOECDGfQHlZ7iWG+TrNF3oUSAjC HXSenz3K5vpUp+6rTVGRxI7gECJ272JECA2yaVhBmflWm95tUKjw3o5U3oyeMZmFHvu3GamJS klWtpyeES8aEFxc5OX6MkTieyhOfierbywrYoTQUobhtV2cMJt6ZoEZHhXVnwj922bn7VFDki xalFouRvizVv7+HKmdYgzBy4/5iRSPemuiahrGe1y9osboVgq7d+cBZl1pMdLuDhHvN6QSH5u /mwDbTvUbszwiTyPHAKLRyNSDpCrfB0BNwDyuW9xzy9MT6p1hV2m9zrxU After looking at the ACPI AML code, it seems that the command 0x0000 used with ACER_WMID_GET_GAMING_SYS_INFO_METHODID returns a bitmap of all supported sensors available through the 0x0001 command. Add support for this command and the additional temperature sensors. This also fixed detection of fan sensors should the fan not spin during device initialization. Signed-off-by: Armin Wolf --- drivers/platform/x86/acer-wmi.c | 129 ++++++++++++++++++++++++-------- 1 file changed, 96 insertions(+), 33 deletions(-) -- 2.39.5 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index dd57787466b9..7b549920eba7 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include MODULE_AUTHOR("Carlos Corbacho"); @@ -70,7 +71,8 @@ MODULE_LICENSE("GPL"); #define ACER_PREDATOR_V4_THERMAL_PROFILE_EC_OFFSET 0x54 -#define ACER_PREDATOR_V4_FAN_SPEED_READ_BIT_MASK GENMASK(20, 8) +#define ACER_PREDATOR_V4_SENSOR_READING_BIT_MASK GENMASK(24, 8) +#define ACER_PREDATOR_V4_SUPPORTED_SENSORS_BIT_MASK GENMASK(40, 24) /* * Acer ACPI method GUIDs @@ -98,9 +100,17 @@ enum acer_wmi_event_ids { }; enum acer_wmi_predator_v4_sys_info_command { - ACER_WMID_CMD_GET_PREDATOR_V4_BAT_STATUS = 0x02, - ACER_WMID_CMD_GET_PREDATOR_V4_CPU_FAN_SPEED = 0x0201, - ACER_WMID_CMD_GET_PREDATOR_V4_GPU_FAN_SPEED = 0x0601, + ACER_WMID_CMD_GET_PREDATOR_V4_SUPPORTED_SENSORS = 0x0000, + ACER_WMID_CMD_GET_PREDATOR_V4_SENSOR_READING = 0x0001, + ACER_WMID_CMD_GET_PREDATOR_V4_BAT_STATUS = 0x0002, +}; + +enum acer_wmi_predator_v4_sensor_id { + ACER_WMID_SENSOR_CPU_TEMPERATURE = 0x01, + ACER_WMID_SENSOR_CPU_FAN_SPEED = 0x02, + ACER_WMID_SENSOR_EXTERNAL_TEMPERATURE_2 = 0x03, + ACER_WMID_SENSOR_GPU_FAN_SPEED = 0x06, + ACER_WMID_SENSOR_GPU_TEMPERATURE = 0x0A, }; static const struct key_entry acer_wmi_keymap[] __initconst = { @@ -271,6 +281,7 @@ static u16 commun_func_bitmap; static u8 commun_fn_key_number; static bool cycle_gaming_thermal_profile = true; static bool predator_v4; +static u64 supported_sensors; module_param(mailled, int, 0444); module_param(brightness, int, 0444); @@ -1513,6 +1524,24 @@ static acpi_status WMID_gaming_get_u64(u64 *value, u32 cap) return status; } +static int WMID_gaming_get_sys_info(u32 command, u64 *out) +{ + acpi_status status; + u64 result; + + status = WMI_gaming_execute_u64(ACER_WMID_GET_GAMING_SYS_INFO_METHODID, command, &result); + if (ACPI_FAILURE(status)) + return -EIO; + + /* The lower 8 bits must be zero for the operation to have succeeded */ + if (result & 0xff) + return -EIO; + + *out = result; + + return 0; +} + static void WMID_gaming_set_fan_mode(u8 fan_mode) { /* fan_mode = 1 is used for auto, fan_mode = 2 used for turbo*/ @@ -1760,26 +1789,6 @@ static int acer_gsensor_event(void) return 0; } -static int acer_get_fan_speed(int fan) -{ - if (quirks->predator_v4) { - acpi_status status; - u64 fanspeed; - - status = WMI_gaming_execute_u64( - ACER_WMID_GET_GAMING_SYS_INFO_METHODID, - fan == 0 ? ACER_WMID_CMD_GET_PREDATOR_V4_CPU_FAN_SPEED : - ACER_WMID_CMD_GET_PREDATOR_V4_GPU_FAN_SPEED, - &fanspeed); - - if (ACPI_FAILURE(status)) - return -EIO; - - return FIELD_GET(ACER_PREDATOR_V4_FAN_SPEED_READ_BIT_MASK, fanspeed); - } - return -EOPNOTSUPP; -} - /* * Predator series turbo button */ @@ -2671,43 +2680,86 @@ static void __init create_debugfs(void) &interface->debug.wmid_devices); } +static const enum acer_wmi_predator_v4_sensor_id acer_wmi_temp_channel_to_sensor_id[] = { + [0] = ACER_WMID_SENSOR_CPU_TEMPERATURE, + [1] = ACER_WMID_SENSOR_GPU_TEMPERATURE, + [2] = ACER_WMID_SENSOR_EXTERNAL_TEMPERATURE_2, +}; + +static const enum acer_wmi_predator_v4_sensor_id acer_wmi_fan_channel_to_sensor_id[] = { + [0] = ACER_WMID_SENSOR_CPU_FAN_SPEED, + [1] = ACER_WMID_SENSOR_GPU_FAN_SPEED, +}; + static umode_t acer_wmi_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, int channel) { + enum acer_wmi_predator_v4_sensor_id sensor_id; + const u64 *supported_sensors = data; + switch (type) { + case hwmon_temp: + sensor_id = acer_wmi_temp_channel_to_sensor_id[channel]; + break; case hwmon_fan: - if (acer_get_fan_speed(channel) >= 0) - return 0444; + sensor_id = acer_wmi_fan_channel_to_sensor_id[channel]; break; default: return 0; } + if (*supported_sensors & BIT(sensor_id - 1)) + return 0444; + return 0; } static int acer_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel, long *val) { + enum acer_wmi_predator_v4_sensor_id sensor_id; + u64 command, result; int ret; switch (type) { + case hwmon_temp: + sensor_id = acer_wmi_temp_channel_to_sensor_id[channel]; + command = ACER_WMID_CMD_GET_PREDATOR_V4_SENSOR_READING | (sensor_id << 8); + + ret = WMID_gaming_get_sys_info(command, &result); + if (ret < 0) + return ret; + + result = FIELD_GET(ACER_PREDATOR_V4_SENSOR_READING_BIT_MASK, result); + *val = result * MILLIDEGREE_PER_DEGREE; + return 0; case hwmon_fan: - ret = acer_get_fan_speed(channel); + sensor_id = acer_wmi_fan_channel_to_sensor_id[channel]; + command = ACER_WMID_CMD_GET_PREDATOR_V4_SENSOR_READING | (sensor_id << 8); + + ret = WMID_gaming_get_sys_info(command, &result); if (ret < 0) return ret; - *val = ret; - break; + + *val = FIELD_GET(ACER_PREDATOR_V4_SENSOR_READING_BIT_MASK, result); + return 0; default: return -EOPNOTSUPP; } - - return 0; } static const struct hwmon_channel_info *const acer_wmi_hwmon_info[] = { - HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT, HWMON_F_INPUT), NULL + HWMON_CHANNEL_INFO(temp, + HWMON_T_INPUT, + HWMON_T_INPUT, + HWMON_T_INPUT + ), + HWMON_CHANNEL_INFO(fan, + HWMON_F_INPUT, + HWMON_F_INPUT + ), + NULL }; static const struct hwmon_ops acer_wmi_hwmon_ops = { @@ -2724,9 +2776,20 @@ static int acer_wmi_hwmon_init(void) { struct device *dev = &acer_platform_device->dev; struct device *hwmon; + u64 result; + int ret; + + ret = WMID_gaming_get_sys_info(ACER_WMID_CMD_GET_PREDATOR_V4_SUPPORTED_SENSORS, &result); + if (ret < 0) + return ret; + + /* Return early if no sensors are available */ + supported_sensors = FIELD_GET(ACER_PREDATOR_V4_SUPPORTED_SENSORS_BIT_MASK, result); + if (!supported_sensors) + return 0; hwmon = devm_hwmon_device_register_with_info(dev, "acer", - &acer_platform_driver, + &supported_sensors, &acer_wmi_hwmon_chip_info, NULL); From patchwork Sun Nov 24 17:14:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13884170 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B94313C67C; Sun, 24 Nov 2024 17:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468493; cv=none; b=dFjaH3kX8NqS44nyOwqaQRQV89o3L/52WMNGL2I/se5DktxaBh+ELUj68uyYHYjT5bqAq5W6BPVSkFrQ0KIoVf9FkMhMPxioxSy3NBwM7hVXK0ffh4sygyXJ51DDwNObuEzV0mUrF3f2zDll7QR1N4DR/e6jXXwgi84JTqi7xQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468493; c=relaxed/simple; bh=jeJr9pNckNqyUtItMreZp/xbZoNuzRhND+ij3pWjuOM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uJHn7ZevJiwdvLa6T7DdtaI0ANhGqk/P61DXcAzGzwOR++mGWl3Xf4sYbN020N08+aidr0gMIsKG7yd+0DUJPfBZg+jKwedWHg9QxuquDDjpQMN4jEWOOdrRCHkqW2lc+YzaONJiBFNfgjW+QOk27InhbZKU5QavhbFIsosnJo4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=SQLwZXDW; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="SQLwZXDW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1732468484; x=1733073284; i=w_armin@gmx.de; bh=5csBIJ5NYZF2Vp9CmRhZS/Mn3fYDpyfQnXs60XIx8Pg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=SQLwZXDWbTF8IvY2tBCLl0FHl2MjME7GiYMKQ9o+ZFHUu+9K3SdaG7RYRm5CyM/D inJ1S7kD3/fVFl1Kn/EuvM5Yzrfo23sKHNp6Ckuw164DjTFl+vOSGHAURSLsxosET VLcvznSFudLI4BcKg08HbqJ3PVAyvwg3Xy9bt1ocu2M0W5vIdTffKDfA7Dgw9KU/z CE/xLsUCF6HaKU1rg1TApPzdFIq+H3teMRyPkVrnmQAt6eYIHRBpksAkYDaZ0Z6KF 8C4XMvqXefGW/Iqu4Ad6eFuYtVTbA++LiGdepJvy6SAXhvg8UZWobk+sWMveAf8Op qUJAfFXdfin8Kby7eQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([141.30.226.119]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MJmKh-1szVYw3IL3-00U36N; Sun, 24 Nov 2024 18:14:43 +0100 From: Armin Wolf To: jlee@suse.com, farhan.anwar8@gmail.com, rayanmargham4@gmail.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 4/5] platform/x86: acer-wmi: Improve error handling when reading AC status Date: Sun, 24 Nov 2024 18:14:25 +0100 Message-Id: <20241124171426.29203-5-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241124171426.29203-1-W_Armin@gmx.de> References: <20241124171426.29203-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:KTC22Ub/XvgdO7f+LCMCexLP8K3fbNSob6bqwD7Gd9k0/u10VwA xnURzPzjH8Feyds3Tg1jEBunojOsuDmpyiyX3CQhGyaKS//9+muBf8lxjNGRbSKTVlzZKd4 6d1uMTazSwSdd4SdV3ARWTjVELvsJQIps/kH0PPKq+Yem4kzGLwEPOhrNwPnutA96+iESBT 7jMGmHAmQ5oBVw9xyuMZg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Dv3MOpZJ4fo=;zNSBzA0V4DBUC/bdoLdrUmGJbkH Fd2Ngc29Wwo7q4hYu3cAGSBMG0b+24arxGdPLmnFlsqTqdfOH5hBRI3XNzfXT7s1weEIoPhhm 2XRJx/rxj7gUzBsQNmZP3PZn++6aKGZyRxThwlHcGxtQnEtm5Z7RawoqhAltnrw/B64R+YKSh 5cEYuomHe3VrBz9K2zV/HMXk/6ah6avtZ210XXXqvZRsV0U3y2XHAZKmZLKHPGSuPpysORbpF CUh7672wVGiwao4lNdl4WzpVJrDfL9YIWemYk4njfBPHHO+swHnsJPOkchrxG15Gr9YWS5Ta0 IcyQ3OfnsUWo7aOgfSf5siWztC+5uiRczMaaSxRCR4t3L7/JrjtVcV8Sp0sdjRdOMYSal3ZMC mg/HTPyjjbGdoekHWruD80YX7AucOnsFUPstluNfVmm4lCRaQswqF+2rHVbtN1CQQAJ2AwcvG mNu3qlYCGKy6btWB5YVeOvIuZN09Rxwi3ni9vmgOf7R3P625AyEHINijLbiDNN1fCaS2wP5dq p5r6LA+uoQQsfYmpc+xsoScqd/QS5xsLgz6OCf+ZwhU41mDdygGbG7e48fFLqghbRpK0cWRQ7 rCIvQarDkTAtE8Et947EGfB1yw29MsiL5joAv9IwIeAcle89VpuBDM+/c+bH1geV9DqM3736g QSbYndnavsD1WTHz1R06vov8xDjcQoepjE1lthiAzKAQMnOkmpAJIWF63DHNYwd6ocuBZci2E 1gnOjiMoZH5f5ZScDvnN2rtMIPCHwXhmEwX9FQCHjejPc2ujMD5muhhpomwpL4sColE1PhJaA 5jhwTUegkW+m4j5bT0zt9GOCx9P6OENJntG4+nCBal4C95Kepo0eA/4H72j355cwqKE7Ld7Pm zxt2b85vESr34+ZAl5ki5FNeLmZXCLP9WP8akUmvEMT3ghtWVHiU5wwf4 If a call to ACER_WMID_GET_GAMING_SYS_INFO_METHODID fails, the lower 8 bits will be non-zero. Use WMID_gaming_get_sys_info() to check for this when reading the AC status. Signed-off-by: Armin Wolf --- drivers/platform/x86/acer-wmi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.39.5 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 7b549920eba7..6964fea84fa1 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1951,12 +1951,9 @@ static int acer_thermal_profile_change(void) return err; /* Check power source */ - status = WMI_gaming_execute_u64( - ACER_WMID_GET_GAMING_SYS_INFO_METHODID, - ACER_WMID_CMD_GET_PREDATOR_V4_BAT_STATUS, &on_AC); - - if (ACPI_FAILURE(status)) - return -EIO; + err = WMID_gaming_get_sys_info(ACER_WMID_CMD_GET_PREDATOR_V4_BAT_STATUS, &on_AC); + if (err < 0) + return err; switch (current_tp) { case ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO: From patchwork Sun Nov 24 17:14:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13884171 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75E7F148300; Sun, 24 Nov 2024 17:14:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468496; cv=none; b=JvmBA/mtYyZ70cnu3WAEjpowPLLTlVAGo4o5lSKAycY3GiniH/9SjtLVbtKP2TE5omYHhx5I4wjxu1pU8rKVWVMV7DJdo2LqVXGl4MppQxLUXKU7X/+1P1+pqmpAHGbrvWvk3IsdNZZipDW+d8aI+K2CFhdmrbF72IpCykNOFlk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732468496; c=relaxed/simple; bh=mzzZCDT4apevZdSoi/1I/xkCLKfdfaKYP2QGEvMmaLY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oFdk8P7vIdTBIfxpoCSzvTBglSTFRGCxNuNc/b03vhFm2dmzxy9dMaxl/u3fU4wpt4rSm49EYjsQR6v8jFlkFdZnzICkdGcoPapf9BeQiPkHVtJfn9b7VJMzk8I59IqbfC0RAT6zi8WvckVrzY0+T4sZFuXUoL9pKdHhFu8P7dY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=HgEWe/9W; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="HgEWe/9W" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1732468486; x=1733073286; i=w_armin@gmx.de; bh=SvrPVsAm5TseWOQrJsUD7l2NbvUMXNQH8wvoQdhPT6Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=HgEWe/9WivVQmYmVn/VBOi83f5rBR96BSF8h40gt8gnZrYTImsxxdF1pEMgxAH5S JzdkxeQwAWChm9CkL7agZ1Hdb4ZEdcQHRdu2Yko54vEp0R7/rRIv1bzHlfFuTTJbx 6MOYjP9anpolVB+FSVsYIJrBeko/BayROBNcPStdMs7Gd9PQjp+upR8Bf7ysdk29u sS/2sOVCdh4rl6IkbIa+NVqYVOR+YlhscEcoa/n179PH1GFGIn9H1GFnq0Bz6oYrw HBALN1TUto9wd2QGZL3SrFOYKzejlMdYRXdAHinyIxvNr0pEgQUPaJ8PC5j6wpLmy bX9sPY0NGTmfDhrSfg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([141.30.226.119]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N2E1M-1tiUtn3w4c-00ybzh; Sun, 24 Nov 2024 18:14:46 +0100 From: Armin Wolf To: jlee@suse.com, farhan.anwar8@gmail.com, rayanmargham4@gmail.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 5/5] platform/x86: acer-wmi: Ignore AC events Date: Sun, 24 Nov 2024 18:14:26 +0100 Message-Id: <20241124171426.29203-6-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241124171426.29203-1-W_Armin@gmx.de> References: <20241124171426.29203-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:k0On+4OSPz+hHluHv8K09QPFIQKbZuvsX1umrwKCxWipua9RFm+ viQqRvndXfgtw/jN5TXlT5q5RCllaYsdD+5j1P/VoKZEByESoO4ieyW7OOMWjIa7pBAr/P6 1KoyzzZI1PTWT65UylRYYm4WL6pif8+cCuo2bk7VVkI1J99YEfbqDOtHBdTXN+HRPAJQHpi mApn0sZ/esb8pM6KMyXSw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YXj3lUSOm9Q=;FBolMd4+D2pSAiBl3kVkMw7QMUC aTfcedW8Z4fV84CmfWmLu8n8iM664Z2oMsKVWhtD0gPt57rcdj0yeRvZuBUEF6VeCzFciLyuS sj27rI8UkCG+NvCMzUibUVRH1vszfwrqP7XqGUBMmLUB8+75G6ilroFS6bwSvRKStafa+2tHt G7FrJREF/A+5ZZcZvoemNOhkYLP8k37RcTdS1tA7LuHUxBhBQWiBOv4lU3xSUCrCahHuGphYn 7mH+wscxNA77NkRfXZgHULf852eXpx7q2aQ5SQ8+jvnhn3fDucoBOO1NHPjJ1lYrLiu/MGyWh F+fv+lJFcPGcpyKLohUZSndNqJiQ3rAGn/UevZaPqFyVnXexArM+W2Lv1/0CceF7rJipOaf2K dE10HDafh7lWHrG3I/bQjHb3xZctRlKL8DN+CqyEvJYlcjdbYVJndyv5J/Z7aUR5FseoH7D52 6iTn8Mi74sa9EGDFkbwFkUhn30l348rBrFfr62zqjh9PBx9U3yni3UAYgwD6t3PlrWbeupc8c sZGUydmG4QP45ct+SJHGyYrPdprLo+LDQjsvIKM6FN9umAIJXrlfj2tv7S0Xx9jdRy11alxlw VSPX4iHygGW3VyM3ctEr5iesmKvwGLpX9+nFHsSs8XzHRh9yT68uHWgDtjNcXbpWKw2lq3ICq UWPwYITnGRne12hVEdI9HswJlRDOwIA1hYJppkxUMrvAzzim0vIOdnFbVlwRhMu0eYItwyVRZ 0QCgcWg9MpGVwmOKVRo6Ax8nu08FVasoLxXd5Tg+1gaKo/IgdBix0s5Elqnqc97JxnTvICcLq aQLQdUxCOfGktK+kyTtCc6SeyF5sJSEg1DAbi1P7NvjTEXgPkj7Lzy6IV2nIYbJoIPW+ExQEv 5PXwM+yH/w9e+HUyqBCqBnLT4Jg4T8m5q8s5IR9MD2ifFcctLXrRF1cBohvmARUrbU1CkoEG7 Y8JJh9wvTn0OadTizeDA94agtfozapzC4yf85LDqqWTzU3VfZk3ErVqwsDp1IAjHuacBG6jx1 Sd+Otu0VuH3RUkZxMK+psTVYXUq5lBSpyb0QgGqvpapySXk6PWQcLIof6Hk+svYS02zJ8Jwzt WpIpHUv5d4PsreCHB9N/aZr/gh1RDJ On the Acer Swift SFG14-41, the events 8 - 1 and 8 - 0 are printed on AC connect/disconnect. Ignore those events to avoid spamming the kernel log with error messages. Reported-by: Farhan Anwar Closes: https://lore.kernel.org/platform-driver-x86/2ffb529d-e7c8-4026-a3b8-120c8e7afec8@gmail.com Signed-off-by: Armin Wolf --- drivers/platform/x86/acer-wmi.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.39.5 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 6964fea84fa1..73243090242d 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -97,6 +97,7 @@ enum acer_wmi_event_ids { WMID_HOTKEY_EVENT = 0x1, WMID_ACCEL_OR_KBD_DOCK_EVENT = 0x5, WMID_GAMING_TURBO_KEY_EVENT = 0x7, + WMID_AC_EVENT = 0x8, }; enum acer_wmi_predator_v4_sys_info_command { @@ -2302,6 +2303,9 @@ static void acer_wmi_notify(union acpi_object *obj, void *context) if (return_value.key_num == 0x5 && has_cap(ACER_CAP_PLATFORM_PROFILE)) acer_thermal_profile_change(); break; + case WMID_AC_EVENT: + /* We ignore AC events here */ + break; default: pr_warn("Unknown function number - %d - %d\n", return_value.function, return_value.key_num);