From nobody Sat Feb 7 08:44:04 2026 Received: from wfout8-smtp.messagingengine.com (wfout8-smtp.messagingengine.com [64.147.123.151]) (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 0BEF31391; Thu, 4 Apr 2024 00:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189832; cv=none; b=iya4q4sG6wwya+jQNA3vUkoS690hbY4PpdGZ5MiFoyKxSnSQLt62Rq/6QFCG28eQZIBscxBdKdRHiiaIzUTUshWoIn4dEEgt+BU7EXrORQYKK1zrrXgLm/Vl08S93nAvEKFg7YaK5YuGQ8ho/nLvkOSLRIchPlbkApjdDOzMYOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189832; c=relaxed/simple; bh=4CdxyI36NoYF3ibohNO2SZBa2ORShXjHwJVRoQLrb9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uK8sqQGukALVwTVRJiK7w5rGdDkN7I/mjaH64QtPk9jTPCd1T5Se5BgaweYgdcKiTDuIIprj33adYe6A1+RpBS8PfGadf84Z04ZH8uPkm5miTkkomE9bPWdxN7d+Ipp80pE9WA5/xQ54aF7fNRA6WQicQiRNxY5s4dzGae3Nk0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=dTXx46zN; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=REkoCeqA; arc=none smtp.client-ip=64.147.123.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="dTXx46zN"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="REkoCeqA" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id 178761C00101; Wed, 3 Apr 2024 20:17:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2024 20:17:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189827; x=1712276227; bh=YKGAXGmzJ7M8+Kbnl7Jzla5MWweHM6jjVjw3PA3ZJQ4=; b= dTXx46zN/1RoiSpQH5q6RaNnnBnlYcCkIdtPVi+t8AS+Hnnb2c5Uflh7X6bkRJUG OfllAxGZuo4DyIkMfrXpBeHyGq6ijS/UwwzqG396q79EHkiapehmY7TYVqiYFJOt jrRnZQbSkN1A5kWrf5758/EKiiPnVU0zfz5A2NrZDU5TuiJtt2E/RwWyX0nHS5Og 2OfTYn54ktozFQqo/4N4Bht3tV7TaaBVa9LnZ7BFfJVNq7Q6FWOnDsJgj7VkFDyS 0PZwUFw3dcf5/GIH6zvYSI2qpniGa87JlvqUFC6uEplC41PdOOb+rBWh/Shzt4KS ImGkTF77PBBlUczjjbVfcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189827; x= 1712276227; bh=YKGAXGmzJ7M8+Kbnl7Jzla5MWweHM6jjVjw3PA3ZJQ4=; b=R EkoCeqAUrAbprYfhqEWRsqwEt/zNKJNoOWdaJCtjC19ntoVFrbP7ZzbZz79rKItQ goxnDgMuIsR9/t3UU2Vx7IVODNbxQwgyCKiO9m+M+IeOpVIx3ITx77bFEx63oE60 a7AMxgFsYfEB335TMQ00c612R9DSaTnJygvGDlJeqHc/VqVtHgkb8TBb7yn7LE2V bzFsqVDkbXkLjEFhTKyYjx3NhoyVVfqyAznsXJYsLX/9ajW0CVnOaKHkJR+bs7vc 9RNf++RVc+Xwt1CMntpmaDsnJD9kym6dtVpmoW5J9M3d0fBQZWO/7sgOOGwjq1Js dAWNEEMo6+AqsudSn4KLw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:04 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 1/9] platform/x86: asus-wmi: add support for 2024 ROG Mini-LED Date: Thu, 4 Apr 2024 13:16:44 +1300 Message-ID: <20240404001652.86207-2-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Support the 2024 mini-led backlight and adjust the related functions to select the relevant dev-id. Also add `available_mini_led_mode` to the platform sysfs since the available mini-led levels can be different. Reviewed-by: Ilpo J=C3=A4rvinen signed-off-by: Luke D. Jones --- .../ABI/testing/sysfs-platform-asus-wmi | 8 ++ drivers/platform/x86/asus-wmi.c | 96 +++++++++++++++++-- include/linux/platform_data/x86/asus-wmi.h | 1 + 3 files changed, 95 insertions(+), 10 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentat= ion/ABI/testing/sysfs-platform-asus-wmi index 8a7e25bde085..ef1ac1a20a71 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-wmi +++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi @@ -126,6 +126,14 @@ Description: Change the mini-LED mode: * 0 - Single-zone, * 1 - Multi-zone + * 2 - Multi-zone strong (available on newer generation mini-led) + +What: /sys/devices/platform//available_mini_led_mode +Date: Apr 2024 +KernelVersion: 6.10 +Contact: "Luke Jones" +Description: + List the available mini-led modes. =20 What: /sys/devices/platform//ppt_pl1_spl Date: Jun 2023 diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index 3f07bbf809ef..aa2a3b402e33 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -126,6 +126,17 @@ module_param(fnlock_default, bool, 0444); #define ASUS_SCREENPAD_BRIGHT_MAX 255 #define ASUS_SCREENPAD_BRIGHT_DEFAULT 60 =20 +#define ASUS_MINI_LED_MODE_MASK 0x03 +/* Standard modes for devices with only on/off */ +#define ASUS_MINI_LED_OFF 0x00 +#define ASUS_MINI_LED_ON 0x01 +/* New mode on some devices, define here to clarify remapping later */ +#define ASUS_MINI_LED_STRONG_MODE 0x02 +/* New modes for devices with 3 mini-led mode types */ +#define ASUS_MINI_LED_2024_WEAK 0x00 +#define ASUS_MINI_LED_2024_STRONG 0x01 +#define ASUS_MINI_LED_2024_OFF 0x02 + /* Controls the power state of the USB0 hub on ROG Ally which input is on = */ #define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE" /* 300ms so far seems to produce a reliable result on AC and battery */ @@ -288,7 +299,7 @@ struct asus_wmi { bool battery_rsoc_available; =20 bool panel_overdrive_available; - bool mini_led_mode_available; + u32 mini_led_dev_id; =20 struct hotplug_slot hotplug_slot; struct mutex hotplug_lock; @@ -2108,13 +2119,33 @@ static ssize_t mini_led_mode_show(struct device *de= v, struct device_attribute *attr, char *buf) { struct asus_wmi *asus =3D dev_get_drvdata(dev); - int result; + u32 value; + int err; =20 - result =3D asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MINI_LED_MOD= E); - if (result < 0) - return result; + err =3D asus_wmi_get_devstate(asus, asus->mini_led_dev_id, &value); + if (err < 0) + return err; + value =3D value & ASUS_MINI_LED_MODE_MASK; =20 - return sysfs_emit(buf, "%d\n", result); + /* + * Remap the mode values to match previous generation mini-led. The last = gen + * WMI 0 =3D=3D off, while on this version WMI 2 =3D=3Doff (flipped). + */ + if (asus->mini_led_dev_id =3D=3D ASUS_WMI_DEVID_MINI_LED_MODE2) { + switch (value) { + case ASUS_MINI_LED_2024_WEAK: + value =3D ASUS_MINI_LED_ON; + break; + case ASUS_MINI_LED_2024_STRONG: + value =3D ASUS_MINI_LED_STRONG_MODE; + break; + case ASUS_MINI_LED_2024_OFF: + value =3D ASUS_MINI_LED_OFF; + break; + } + } + + return sysfs_emit(buf, "%d\n", value); } =20 static ssize_t mini_led_mode_store(struct device *dev, @@ -2130,11 +2161,32 @@ static ssize_t mini_led_mode_store(struct device *d= ev, if (result) return result; =20 - if (mode > 1) + if (asus->mini_led_dev_id =3D=3D ASUS_WMI_DEVID_MINI_LED_MODE && + mode > ASUS_MINI_LED_ON) + return -EINVAL; + if (asus->mini_led_dev_id =3D=3D ASUS_WMI_DEVID_MINI_LED_MODE2 && + mode > ASUS_MINI_LED_STRONG_MODE) return -EINVAL; =20 - err =3D asus_wmi_set_devstate(ASUS_WMI_DEVID_MINI_LED_MODE, mode, &result= ); + /* + * Remap the mode values so expected behaviour is the same as the last + * generation of mini-LED with 0 =3D=3D off, 1 =3D=3D on. + */ + if (asus->mini_led_dev_id =3D=3D ASUS_WMI_DEVID_MINI_LED_MODE2) { + switch (mode) { + case ASUS_MINI_LED_OFF: + mode =3D ASUS_MINI_LED_2024_OFF; + break; + case ASUS_MINI_LED_ON: + mode =3D ASUS_MINI_LED_2024_WEAK; + break; + case ASUS_MINI_LED_STRONG_MODE: + mode =3D ASUS_MINI_LED_2024_STRONG; + break; + } + } =20 + err =3D asus_wmi_set_devstate(asus->mini_led_dev_id, mode, &result); if (err) { pr_warn("Failed to set mini-LED: %d\n", err); return err; @@ -2151,6 +2203,23 @@ static ssize_t mini_led_mode_store(struct device *de= v, } static DEVICE_ATTR_RW(mini_led_mode); =20 +static ssize_t available_mini_led_mode_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + switch (asus->mini_led_dev_id) { + case ASUS_WMI_DEVID_MINI_LED_MODE: + return sysfs_emit(buf, "0 1\n"); + case ASUS_WMI_DEVID_MINI_LED_MODE2: + return sysfs_emit(buf, "0 1 2\n"); + } + + return sysfs_emit(buf, "0\n"); +} + +static DEVICE_ATTR_RO(available_mini_led_mode); + /* Quirks ****************************************************************= *****/ =20 static void asus_wmi_set_xusb2pr(struct asus_wmi *asus) @@ -4139,6 +4208,7 @@ static struct attribute *platform_attributes[] =3D { &dev_attr_nv_temp_target.attr, &dev_attr_panel_od.attr, &dev_attr_mini_led_mode.attr, + &dev_attr_available_mini_led_mode.attr, NULL }; =20 @@ -4191,7 +4261,9 @@ static umode_t asus_sysfs_is_visible(struct kobject *= kobj, else if (attr =3D=3D &dev_attr_panel_od.attr) ok =3D asus->panel_overdrive_available; else if (attr =3D=3D &dev_attr_mini_led_mode.attr) - ok =3D asus->mini_led_mode_available; + ok =3D asus->mini_led_dev_id !=3D 0; + else if (attr =3D=3D &dev_attr_available_mini_led_mode.attr) + ok =3D asus->mini_led_dev_id !=3D 0; =20 if (devid !=3D -1) ok =3D !(asus_wmi_get_devstate_simple(asus, devid) < 0); @@ -4444,10 +4516,14 @@ static int asus_wmi_add(struct platform_device *pde= v) asus->nv_dyn_boost_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_NV_DYN_BOOST); asus->nv_temp_tgt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_NV_THERM_TARGET); asus->panel_overdrive_available =3D asus_wmi_dev_is_present(asus, ASUS_WM= I_DEVID_PANEL_OD); - asus->mini_led_mode_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_= DEVID_MINI_LED_MODE); asus->ally_mcu_usb_switch =3D acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSE= E) && dmi_match(DMI_BOARD_NAME, "RC71L"); =20 + if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE)) + asus->mini_led_dev_id =3D ASUS_WMI_DEVID_MINI_LED_MODE; + else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE2)) + asus->mini_led_dev_id =3D ASUS_WMI_DEVID_MINI_LED_MODE2; + err =3D fan_boost_mode_check_present(asus); if (err) goto fail_fan_boost_mode; diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/pla= tform_data/x86/asus-wmi.h index ab1c7deff118..9cadce10ad9a 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -71,6 +71,7 @@ #define ASUS_WMI_DEVID_LID_FLIP 0x00060062 #define ASUS_WMI_DEVID_LID_FLIP_ROG 0x00060077 #define ASUS_WMI_DEVID_MINI_LED_MODE 0x0005001E +#define ASUS_WMI_DEVID_MINI_LED_MODE2 0x0005002E =20 /* Storage */ #define ASUS_WMI_DEVID_CARDREADER 0x00080013 --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfout8-smtp.messagingengine.com (wfout8-smtp.messagingengine.com [64.147.123.151]) (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 A4AF54689; Thu, 4 Apr 2024 00:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189835; cv=none; b=RJcFeKkahuw1UFNYastrA4FQMf5YTPIb+mzObGE5INz01AjfyPA9v3Ja3NfI3fH20qVtt0VO0UPUKCVlXRG1LjHTxJaJ6q++NWpE5J6/ziG/F0BrHxDyZntAujGeGxKPRzEHTl7wslHbhXdWLu90sys5BZEOjbpqOiFIAl5/XQU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189835; c=relaxed/simple; bh=rRBy78XJkXwKq481LTr0KBcVt2ywwY9zR5Us2F6/UNw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H+C4A0KktlXwigw+UGGszglfHbFOfytQNDVPkVcwjBUPNWVzB2G1MV7qrCrvCR2tLrVj3DajCWfbyxxADSc/Yrj4VpfaAVX68rHEHln4dcvziQMRBrm0r5qVJLqFRijSUuC8+h4VAUDyr9tg6diba/wu063x3FY1hA0oe8Qx2J4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=krCXRW0s; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=rDtnrsjr; arc=none smtp.client-ip=64.147.123.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="krCXRW0s"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="rDtnrsjr" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id 6B8CE1C000F7; Wed, 3 Apr 2024 20:17:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 03 Apr 2024 20:17:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189831; x=1712276231; bh=p9FSwkCbMAz+HXaWekWfWscMDEXU3+ZywSKVQIvHfE4=; b= krCXRW0sVY/5ZcAeKOyq02mndGLKtJn2bJh1pUBoCVTXu3QwsVAuYTBgVWPf7GoV BJ7B2SFZY8rTCCPNNR9hnCoQc9JKlSOj4IPMK/1Nyckbgw+Wf9SnjuYnSsStCZdj 1XCVbSTLA59aCV0r9otJWKQjiUzj3spOluAxlHHxYTqrx0s/o7lMFpV6sIPwYAM3 9hWFdTdGygevg+SeH2lZU244Yb00r0TucmMPhxDsP3AkWjukC9EKIZjAuCM3I0mz f7EKI+RL4iXDt5HqK14KEvOTIxPeyHe78iYDBn3+bIgXAVnS8kkcmDknrNr+u47p w64e0sO4/+m1kxVNVCwC6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189831; x= 1712276231; bh=p9FSwkCbMAz+HXaWekWfWscMDEXU3+ZywSKVQIvHfE4=; b=r Dtnrsjr5m+ncljyNktgceuh+CvjbzQniz02mwztnF1wK9VsnflrU//ZDyigZcBM5 aoF45RqIpl4RTRF2A7dLcwekMFVCv8V9XdS3jn/cdWLMcHGi+c81E2tTLG0De2gC oWqdOHMO7QtRkNAbMzNqlDb5BDXcFC4Lo2sO1rdFMLiJY+qD95SrHqjoR2BN7oO7 O5S9Z/KuLj8/yamG6Jh2F7z1VcUOZsTAKkrWE2KWYDrGzpUPaahWsbsMl9qV8clx IqgPEFXjpSVW2QK60K5dAh8B177oCrZ7p/YMA18P/ggvyLF0jJwzb1CbdS+RVRmD oF8k/k+67OCfe+nSRNZxQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:09 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 2/9] platform/x86: asus-wmi: add support for Vivobook GPU MUX Date: Thu, 4 Apr 2024 13:16:45 +1300 Message-ID: <20240404001652.86207-3-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add support for the Vivobook dgpu MUX available on the ASUS Viviobook and some of the other ranges (Zen). This MUX functions exactly the same as the existing ROG MUX support so the existing functionality now detects which MUX is available and uses that for control. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 22 +++++++++++++--------- include/linux/platform_data/x86/asus-wmi.h | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index aa2a3b402e33..1ab4380e9771 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -270,7 +270,7 @@ struct asus_wmi { bool egpu_enable_available; bool egpu_connect_available; bool dgpu_disable_available; - bool gpu_mux_mode_available; + u32 gpu_mux_dev; =20 /* Tunables provided by ASUS for gaming laptops */ bool ppt_pl2_sppt_available; @@ -693,8 +693,8 @@ static ssize_t dgpu_disable_store(struct device *dev, if (disable > 1) return -EINVAL; =20 - if (asus->gpu_mux_mode_available) { - result =3D asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPU_MUX); + if (asus->gpu_mux_dev) { + result =3D asus_wmi_get_devstate_simple(asus, asus->gpu_mux_dev); if (result < 0) /* An error here may signal greater failure of GPU handling */ return result; @@ -759,8 +759,8 @@ static ssize_t egpu_enable_store(struct device *dev, return err; } =20 - if (asus->gpu_mux_mode_available) { - result =3D asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPU_MUX); + if (asus->gpu_mux_dev) { + result =3D asus_wmi_get_devstate_simple(asus, asus->gpu_mux_dev); if (result < 0) { /* An error here may signal greater failure of GPU handling */ pr_warn("Failed to get gpu mux status: %d\n", result); @@ -813,7 +813,7 @@ static ssize_t gpu_mux_mode_show(struct device *dev, struct asus_wmi *asus =3D dev_get_drvdata(dev); int result; =20 - result =3D asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPU_MUX); + result =3D asus_wmi_get_devstate_simple(asus, asus->gpu_mux_dev); if (result < 0) return result; =20 @@ -859,7 +859,7 @@ static ssize_t gpu_mux_mode_store(struct device *dev, } } =20 - err =3D asus_wmi_set_devstate(ASUS_WMI_DEVID_GPU_MUX, optimus, &result); + err =3D asus_wmi_set_devstate(asus->gpu_mux_dev, optimus, &result); if (err) { dev_err(dev, "Failed to set GPU MUX mode: %d\n", err); return err; @@ -4239,7 +4239,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *= kobj, else if (attr =3D=3D &dev_attr_dgpu_disable.attr) ok =3D asus->dgpu_disable_available; else if (attr =3D=3D &dev_attr_gpu_mux_mode.attr) - ok =3D asus->gpu_mux_mode_available; + ok =3D asus->gpu_mux_dev !=3D 0; else if (attr =3D=3D &dev_attr_fan_boost_mode.attr) ok =3D asus->fan_boost_mode_available; else if (attr =3D=3D &dev_attr_throttle_thermal_policy.attr) @@ -4505,7 +4505,6 @@ static int asus_wmi_add(struct platform_device *pdev) asus->egpu_enable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_EGPU); asus->egpu_connect_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_EGPU_CONNECTED); asus->dgpu_disable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_DGPU); - asus->gpu_mux_mode_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_GPU_MUX); asus->kbd_rgb_mode_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_TUF_RGB_MODE); asus->kbd_rgb_state_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_= DEVID_TUF_RGB_STATE); asus->ppt_pl2_sppt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_PPT_PL2_SPPT); @@ -4524,6 +4523,11 @@ static int asus_wmi_add(struct platform_device *pdev) else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE2)) asus->mini_led_dev_id =3D ASUS_WMI_DEVID_MINI_LED_MODE2; =20 + if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX)) + asus->gpu_mux_dev =3D ASUS_WMI_DEVID_GPU_MUX; + else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO)) + asus->gpu_mux_dev =3D ASUS_WMI_DEVID_GPU_MUX_VIVO; + err =3D fan_boost_mode_check_present(asus); if (err) goto fail_fan_boost_mode; diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/pla= tform_data/x86/asus-wmi.h index 9cadce10ad9a..b48b024dd844 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -128,6 +128,7 @@ =20 /* gpu mux switch, 0 =3D dGPU, 1 =3D Optimus */ #define ASUS_WMI_DEVID_GPU_MUX 0x00090016 +#define ASUS_WMI_DEVID_GPU_MUX_VIVO 0x00090026 =20 /* TUF laptop RGB modes/colours */ #define ASUS_WMI_DEVID_TUF_RGB_MODE 0x00100056 --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfhigh8-smtp.messagingengine.com (wfhigh8-smtp.messagingengine.com [64.147.123.159]) (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 267DA8462; Thu, 4 Apr 2024 00:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189839; cv=none; b=FBo9MAO+os4JaRESyIVAnKuMHCTyo4fFaY4Km8UjWyuBBGk4Kgl/ExzlZPehgJM47HJL5X3sb1mEBrlcXRNv0whXztFaWCx4h6qOAOiWqw/bQaV/Jr6ddaYUNskVvCERl0SlQZspM6jZC4+c0l22UOxHRa3d+6U3DddnW+HULq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189839; c=relaxed/simple; bh=BDM+uHjAeszpHyFFAxX7i9RiVw2Ng2s5OMK1+h3nC4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iqDrr73L0L7OgMNEoS3VGbsPsAPGeqBQXrC0OV3k+PXUA+92lLEzjxP2y5gOCWIk2E1dWfI4/hO/7+nNDVry3VtCjN0sfDbhRlsCP3IiI7D8h1hGuEcM6k1N1r/SRNzEq0D6iLJmqZSQ1cHEp7RcSTxaN51RaPkobJTL8S1tLFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=sGaeZ7mw; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A88Y/rcB; arc=none smtp.client-ip=64.147.123.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="sGaeZ7mw"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A88Y/rcB" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id B309318000DD; Wed, 3 Apr 2024 20:17:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 03 Apr 2024 20:17:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189836; x=1712276236; bh=DqglvZr5k/JEAGAixTdTEp4OkixttBJt7dLokKdRZbg=; b= sGaeZ7mwiqGYLpHU7sSszI8Cdtxsk8/+lqoNEfnNjO560Je3UIPUEwFIVCrk9LAh kiEhcpaTZ9cemwVXo+iPzVstUGueW0RXpNR6MqtOp/cbUaL0NfGiaQPR6BaJDyn3 N0Yk80nPh5dRLfoKFuIBger4E3sC4GgRR2rTtXzxGW8mXnVYT8rCzW1rMQ7r/mSf 4G3Dx/NN86c1ioH3lfP5+lZjrpPU1cH42xg/L27SD5juRkopZLRzU/M+7IQrylAK xWmzIOyNTiv+FNWXg2+GbK3gyn2r6PPA23yTfIn/+X8ZjQIqcquNlsUEP2YRQ44l YLOMslvsz8IDRpY8Io8rCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189836; x= 1712276236; bh=DqglvZr5k/JEAGAixTdTEp4OkixttBJt7dLokKdRZbg=; b=A 88Y/rcBJz2ow5femLbum5fKlqlAvsNtp9SvhqQrOFCkvYnLbKVScpc++4tHtGiat QnT2Wf87SbBEpKM0+j4WKtOuMS1P/tiTCbgOaxEXM51s9Wdvue3oSnSklzi1mwLu 54SBa3CHxRmgr6FpJTV/oCcqcELHg/UZ5CViS7Li15m9Gmj6NlmjRCQ6m+KjnoIy ZmW/75BvyuuERrF57v8RnmDsBbD0SbscIhTnsS9ZO/eypknlbct1GfgRQuksFmnQ lJ1UgW3zZpLwh9tKIgrJI3N7oiXnevjgi3cVk+qywTklV0ooCPJHcsLP5641SPde L9Bbe3rR5fOWMC4hDWGPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:13 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 3/9] platform/x86: asus-wmi: add support variant of TUF RGB Date: Thu, 4 Apr 2024 13:16:46 +1300 Message-ID: <20240404001652.86207-4-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Adds support for a second TUF RGB wmi call that some versions of the TUF laptop come with. Also adjusts existing support to select whichever is available. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 13 +++++++++---- include/linux/platform_data/x86/asus-wmi.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index 1ab4380e9771..6896d056d227 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -281,7 +281,7 @@ struct asus_wmi { bool nv_dyn_boost_available; bool nv_temp_tgt_available; =20 - bool kbd_rgb_mode_available; + u32 kbd_rgb_dev; bool kbd_rgb_state_available; =20 bool throttle_thermal_policy_available; @@ -881,6 +881,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); u32 cmd, mode, r, g, b, speed; int err; =20 @@ -917,7 +918,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, speed =3D 0xeb; } =20 - err =3D asus_wmi_evaluate_method3(ASUS_WMI_METHODID_DEVS, ASUS_WMI_DEVID_= TUF_RGB_MODE, + err =3D asus_wmi_evaluate_method3(ASUS_WMI_METHODID_DEVS, asus->kbd_rgb_d= ev, cmd | (mode << 8) | (r << 16) | (g << 24), b | (speed << 8), NULL); if (err) return err; @@ -1560,7 +1561,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus) { int rv =3D 0, num_rgb_groups =3D 0, led_val; =20 - if (asus->kbd_rgb_mode_available) + if (asus->kbd_rgb_dev) kbd_rgb_mode_groups[num_rgb_groups++] =3D &kbd_rgb_mode_group; if (asus->kbd_rgb_state_available) kbd_rgb_mode_groups[num_rgb_groups++] =3D &kbd_rgb_state_group; @@ -4505,7 +4506,6 @@ static int asus_wmi_add(struct platform_device *pdev) asus->egpu_enable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_EGPU); asus->egpu_connect_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_EGPU_CONNECTED); asus->dgpu_disable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_DGPU); - asus->kbd_rgb_mode_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_TUF_RGB_MODE); asus->kbd_rgb_state_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_= DEVID_TUF_RGB_STATE); asus->ppt_pl2_sppt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_PPT_PL2_SPPT); asus->ppt_pl1_spl_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_PPT_PL1_SPL); @@ -4528,6 +4528,11 @@ static int asus_wmi_add(struct platform_device *pdev) else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO)) asus->gpu_mux_dev =3D ASUS_WMI_DEVID_GPU_MUX_VIVO; =20 + if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE)) + asus->kbd_rgb_dev =3D ASUS_WMI_DEVID_TUF_RGB_MODE; + else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE2)) + asus->kbd_rgb_dev =3D ASUS_WMI_DEVID_TUF_RGB_MODE2; + err =3D fan_boost_mode_check_present(asus); if (err) goto fail_fan_boost_mode; diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/pla= tform_data/x86/asus-wmi.h index b48b024dd844..3e9a01467c67 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -132,6 +132,7 @@ =20 /* TUF laptop RGB modes/colours */ #define ASUS_WMI_DEVID_TUF_RGB_MODE 0x00100056 +#define ASUS_WMI_DEVID_TUF_RGB_MODE2 0x0010005A =20 /* TUF laptop RGB power/state */ #define ASUS_WMI_DEVID_TUF_RGB_STATE 0x00100057 --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfhigh8-smtp.messagingengine.com (wfhigh8-smtp.messagingengine.com [64.147.123.159]) (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 77D7FDF60; Thu, 4 Apr 2024 00:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189844; cv=none; b=Sf9ER2ETU/5YmiCPg32asKsg78gorHd7BDuvPNt6DZ+/TL8rjYDVenCeCeu07q2hAlXQWwg/LcmSU/OCF9RRJLDaoJTqjnRHQJanL8CtK1wOqR19Grg8CJ3RhoWGt9tgabHr5s4DxpqozZNVroGk1SnqPwOFmyGs5Fq6Bci0xqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189844; c=relaxed/simple; bh=Mz2Hn9Bbhw910i4Va4lX79i4MDQkEifZDcencG6pzOo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o4kespmac/hlGb+QyinD1XP8LKR00zAgmQpAJsLoU7z7JIiNfa/v/VisHkxzM3PIz3d5tLi15wansQsMMHKwLiUbX/pzhh3j5/tAnFa/4UR+7qz1+LPreDOSueEeC6iHSsoTy+cJocUb8fx7WrP6l1rVcXTx+Kj2xyXSV6eq0Q4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=jAIN0kFz; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fby9lLUd; arc=none smtp.client-ip=64.147.123.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="jAIN0kFz"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fby9lLUd" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 4702918000DD; Wed, 3 Apr 2024 20:17:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2024 20:17:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189840; x=1712276240; bh=tL6GKGUnXV/u+rWud7+JFDCJA0/ShoGl8Oqjq39YEUQ=; b= jAIN0kFzBkzRHNWYK+/0Veg1LXl8WK+61kAESsD042e3wrD5DHuagB/X5Z34E8yp 1fF5TDHWmxQCFsNSXHx4e2/AhnollVEwkGGJoOUnW3p/V71FaLnU3JjBFPxO/QW2 hIlwqTcE4enqnFSv8aAsln5Ewox09Yj2I3+o6ZYTNi3Ry0bRu6spKKcOx+IWMikb qHvonaQ8crkgIE0ydrnNQBeT8ATAXdqPIf9Me9er0cVSi4xy3VjdjzKFibmI7avT Taxm2ZysOfftWhUQJ4vxt6U935G+6/8j+JMTsOoAZPOwybkFA/vZLqq42gvMASUY /PK5JyRAJ8x9N6iJSexSlw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189840; x= 1712276240; bh=tL6GKGUnXV/u+rWud7+JFDCJA0/ShoGl8Oqjq39YEUQ=; b=f by9lLUdqxncsltzmyzger4bnnJDSXHAkiCrWR4Y+fRuZpNww9PhF5hTOIvZxF87z wJ+q/UhweoQi5cgAP2Mss7UEQrqkCDVtvvME7pi6dD+5QLzreXIZgXSVxDvV1Pn+ uv7ia7LvmjLrdDYtIO6OL1gMLtzhcNznZSj9f/d6mtVvKqLjl7DLonezuM/DONjz XBqNT2Ti+5eAcbcK+jn1jZTU7yOfCWi1lz1bxwZFQL4otowr/ZTsowR5nQfmZW+2 L5PQ/PQ8b6XVZkcvuU06bD8pZKQbgNFDSnbUuXQWjIikWqvZOrlaNXB3sqh/ijx/ l+LQPs8b7ddqULKWkJu2w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedu necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:17 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 4/9] platform/x86: asus-wmi: support toggling POST sound Date: Thu, 4 Apr 2024 13:16:47 +1300 Message-ID: <20240404001652.86207-5-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add support for toggling the BIOS POST sound on some ASUS laptops. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- .../ABI/testing/sysfs-platform-asus-wmi | 9 ++++ drivers/platform/x86/asus-wmi.c | 51 +++++++++++++++++++ include/linux/platform_data/x86/asus-wmi.h | 3 ++ 3 files changed, 63 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentat= ion/ABI/testing/sysfs-platform-asus-wmi index ef1ac1a20a71..72933527d2e4 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-wmi +++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi @@ -194,3 +194,12 @@ Contact: "Luke Jones" Description: Set the target temperature limit of the Nvidia dGPU: * min=3D75, max=3D87 + +What: /sys/devices/platform//boot_sound +Date: Apr 2024 +KernelVersion: 6.10 +Contact: "Luke Jones" +Description: + Set if the BIOS POST sound is played on boot. + * 0 - False, + * 1 - True diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index 6896d056d227..6c353b8e8da9 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -2115,6 +2115,54 @@ static ssize_t panel_od_store(struct device *dev, } static DEVICE_ATTR_RW(panel_od); =20 +/* Bootup sound **********************************************************= *****/ + +static ssize_t boot_sound_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + int result; + + result =3D asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_BOOT_SOUND); + if (result < 0) + return result; + + return sysfs_emit(buf, "%d\n", result); +} + +static ssize_t boot_sound_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + int result, err; + u32 snd; + + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + result =3D kstrtou32(buf, 10, &snd); + if (result) + return result; + + if (snd > 1) + return -EINVAL; + + err =3D asus_wmi_set_devstate(ASUS_WMI_DEVID_BOOT_SOUND, snd, &result); + if (err) { + pr_warn("Failed to set boot sound: %d\n", err); + return err; + } + + if (result > 1) { + pr_warn("Failed to set panel boot sound (result): 0x%x\n", result); + return -EIO; + } + + sysfs_notify(&asus->platform_device->dev.kobj, NULL, "boot_sound"); + + return count; +} +static DEVICE_ATTR_RW(boot_sound); + /* Mini-LED mode *********************************************************= *****/ static ssize_t mini_led_mode_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -4207,6 +4255,7 @@ static struct attribute *platform_attributes[] =3D { &dev_attr_ppt_platform_sppt.attr, &dev_attr_nv_dynamic_boost.attr, &dev_attr_nv_temp_target.attr, + &dev_attr_boot_sound.attr, &dev_attr_panel_od.attr, &dev_attr_mini_led_mode.attr, &dev_attr_available_mini_led_mode.attr, @@ -4259,6 +4308,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *= kobj, ok =3D asus->nv_dyn_boost_available; else if (attr =3D=3D &dev_attr_nv_temp_target.attr) ok =3D asus->nv_temp_tgt_available; + else if (attr =3D=3D &dev_attr_boot_sound.attr) + devid =3D ASUS_WMI_DEVID_BOOT_SOUND; else if (attr =3D=3D &dev_attr_panel_od.attr) ok =3D asus->panel_overdrive_available; else if (attr =3D=3D &dev_attr_mini_led_mode.attr) diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/pla= tform_data/x86/asus-wmi.h index 3e9a01467c67..3eb5cd6773ad 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -137,6 +137,9 @@ /* TUF laptop RGB power/state */ #define ASUS_WMI_DEVID_TUF_RGB_STATE 0x00100057 =20 +/* Bootup sound control */ +#define ASUS_WMI_DEVID_BOOT_SOUND 0x00130022 + /* DSTS masks */ #define ASUS_WMI_DSTS_STATUS_BIT 0x00000001 #define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002 --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfout8-smtp.messagingengine.com (wfout8-smtp.messagingengine.com [64.147.123.151]) (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 8B802101E6; Thu, 4 Apr 2024 00:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189848; cv=none; b=cEugow8SJC2LlxcT3sXfuosvpP0dEWyJQrFQoJIgoyjeZ7u61etj95aeWzd5rEFLEqneXtijedNnT4xb0hfzai3+RNVkfm4oXi5IkKrSV+p1LhJv4/BL6c4LKR/Dr26R0m3hQCA1H9OgqEc59yEeL83bdFZC9XKvQmIAaWYDFh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189848; c=relaxed/simple; bh=OQWkqujwX4pOe4VnxpdfkQ9g7HrkqxvsVGTNxLtlr0k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WaGS8JrS29u+LTaEhIiJ9StdcRoBgkVoiqNp+NbVecarKXRb9QVXyzILDGyF0Hu9YpNvL4AvMO9ax0Bjf49yO8iD4feBGG27gbLwIXp3sbAj51RNVr06GgLyO8G3QZlwqkLr439Jni/lUlEa8pJifaqwBIBT7s5vc4L8E52WuKY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=LChQDO9Q; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=EMcy/Z9H; arc=none smtp.client-ip=64.147.123.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="LChQDO9Q"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EMcy/Z9H" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id 5B8951C000F7; Wed, 3 Apr 2024 20:17:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2024 20:17:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189844; x=1712276244; bh=om3PZj90czUo2IGp6ZEyNddKXfQRlcnve/71xynAn2Q=; b= LChQDO9QnpmrHXXiV7bkU1KuBhSgMdeoMcnAFSGS5gknn7k6QxsDEmZOGUyQPcwO T9lX+vnxGW8DNd4ofDF6qZ+68MroIlblvKJIXWWqJX0q5L9BZtIyIJl2CC7J2/vm e0ZK+t4MpmZZ+zOpI7LV+IRKwfcHMMsjKoLATonfSI1UM+zDKhyY6q7qzJnmcv9O ddHPw+4ily0Ednnv5q2ezoqbkaURtzbiKv5IMK85suENvYehlfWnV/oQ8YK3q0o+ CNnZQOFLkiOSQG0BVCOAZ7PuXOSInXA1t4hBVfQR73qEr8sdr5pszfEmXBbv2NbL joxWCg71yNvdlFr+TESJzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189844; x= 1712276244; bh=om3PZj90czUo2IGp6ZEyNddKXfQRlcnve/71xynAn2Q=; b=E Mcy/Z9HK++eic3gJc7Mkm8ovKPO177k3LcHNj83pe8FQ8uNFTovp7tPzpSoPIwHV vOr0aO9+R8oAJAMXpQv9WjOpCIA5IN712c//AKCcn+teJeZuwdeOkQYFckhr3mth K3MJAfRSaTZMjRFsgg61JGN0Wr/9LctJVCesSKT6T7PAiWoJQ7l7nkvTMoPAM41S jskQsmCbDhDDS2lMsiENHvBMeyX4qUqTlCyl5XTPo7KB8KoNV0x8ihoIpAK8Dm07 859JPdZETjN482K/9wFoG6Hs4ZoJehDOjp6XdhIkziT/3EKdSZcLLzLe6UnIyiKa Qkv76+Z/PUeUkzubIUMgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedv necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:22 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 5/9] platform/x86: asus-wmi: store a min default for ppt options Date: Thu, 4 Apr 2024 13:16:48 +1300 Message-ID: <20240404001652.86207-6-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Laptops with any of the ppt or nv tunables default to the minimum setting on boot so we can safely assume a stored value is correct. This patch adds storing of those values in the local struct, and enables reading of those values back. To prevent creating a series of byte holes in the struct the "_available" bool is removed and `asus_sysfs_is_visible()` uses the `ASUS_WMI_DEVID_` directly. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 127 +++++++++++++++++++++++++------- 1 file changed, 99 insertions(+), 28 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index 6c353b8e8da9..f13606fc62e6 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -273,13 +273,13 @@ struct asus_wmi { u32 gpu_mux_dev; =20 /* Tunables provided by ASUS for gaming laptops */ - bool ppt_pl2_sppt_available; - bool ppt_pl1_spl_available; - bool ppt_apu_sppt_available; - bool ppt_plat_sppt_available; - bool ppt_fppt_available; - bool nv_dyn_boost_available; - bool nv_temp_tgt_available; + u32 ppt_pl2_sppt; + u32 ppt_pl1_spl; + u32 ppt_apu_sppt; + u32 ppt_platform_sppt; + u32 ppt_fppt; + u32 nv_dynamic_boost; + u32 nv_temp_target; =20 u32 kbd_rgb_dev; bool kbd_rgb_state_available; @@ -1031,11 +1031,21 @@ static ssize_t ppt_pl2_sppt_store(struct device *de= v, return -EIO; } =20 + asus->ppt_pl2_sppt =3D value; sysfs_notify(&asus->platform_device->dev.kobj, NULL, "ppt_pl2_sppt"); =20 return count; } -static DEVICE_ATTR_WO(ppt_pl2_sppt); + +static ssize_t ppt_pl2_sppt_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", asus->ppt_pl2_sppt); +} +static DEVICE_ATTR_RW(ppt_pl2_sppt); =20 /* Tunable: PPT, Intel=3DPL1, AMD=3DSPL **********************************= ********/ static ssize_t ppt_pl1_spl_store(struct device *dev, @@ -1065,11 +1075,20 @@ static ssize_t ppt_pl1_spl_store(struct device *dev, return -EIO; } =20 + asus->ppt_pl1_spl =3D value; sysfs_notify(&asus->platform_device->dev.kobj, NULL, "ppt_pl1_spl"); =20 return count; } -static DEVICE_ATTR_WO(ppt_pl1_spl); +static ssize_t ppt_pl1_spl_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", asus->ppt_pl1_spl); +} +static DEVICE_ATTR_RW(ppt_pl1_spl); =20 /* Tunable: PPT APU FPPT *************************************************= *****/ static ssize_t ppt_fppt_store(struct device *dev, @@ -1099,11 +1118,21 @@ static ssize_t ppt_fppt_store(struct device *dev, return -EIO; } =20 + asus->ppt_fppt =3D value; sysfs_notify(&asus->platform_device->dev.kobj, NULL, "ppt_fpu_sppt"); =20 return count; } -static DEVICE_ATTR_WO(ppt_fppt); + +static ssize_t ppt_fppt_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", asus->ppt_fppt); +} +static DEVICE_ATTR_RW(ppt_fppt); =20 /* Tunable: PPT APU SPPT *************************************************= ****/ static ssize_t ppt_apu_sppt_store(struct device *dev, @@ -1133,11 +1162,21 @@ static ssize_t ppt_apu_sppt_store(struct device *de= v, return -EIO; } =20 + asus->ppt_apu_sppt =3D value; sysfs_notify(&asus->platform_device->dev.kobj, NULL, "ppt_apu_sppt"); =20 return count; } -static DEVICE_ATTR_WO(ppt_apu_sppt); + +static ssize_t ppt_apu_sppt_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", asus->ppt_apu_sppt); +} +static DEVICE_ATTR_RW(ppt_apu_sppt); =20 /* Tunable: PPT platform SPPT ********************************************= ****/ static ssize_t ppt_platform_sppt_store(struct device *dev, @@ -1167,11 +1206,21 @@ static ssize_t ppt_platform_sppt_store(struct devic= e *dev, return -EIO; } =20 + asus->ppt_platform_sppt =3D value; sysfs_notify(&asus->platform_device->dev.kobj, NULL, "ppt_platform_sppt"); =20 return count; } -static DEVICE_ATTR_WO(ppt_platform_sppt); + +static ssize_t ppt_platform_sppt_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", asus->ppt_platform_sppt); +} +static DEVICE_ATTR_RW(ppt_platform_sppt); =20 /* Tunable: NVIDIA dynamic boost *****************************************= ****/ static ssize_t nv_dynamic_boost_store(struct device *dev, @@ -1201,11 +1250,21 @@ static ssize_t nv_dynamic_boost_store(struct device= *dev, return -EIO; } =20 + asus->nv_dynamic_boost =3D value; sysfs_notify(&asus->platform_device->dev.kobj, NULL, "nv_dynamic_boost"); =20 return count; } -static DEVICE_ATTR_WO(nv_dynamic_boost); + +static ssize_t nv_dynamic_boost_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", asus->nv_dynamic_boost); +} +static DEVICE_ATTR_RW(nv_dynamic_boost); =20 /* Tunable: NVIDIA temperature target ************************************= ****/ static ssize_t nv_temp_target_store(struct device *dev, @@ -1235,11 +1294,21 @@ static ssize_t nv_temp_target_store(struct device *= dev, return -EIO; } =20 + asus->nv_temp_target =3D value; sysfs_notify(&asus->platform_device->dev.kobj, NULL, "nv_temp_target"); =20 return count; } -static DEVICE_ATTR_WO(nv_temp_target); + +static ssize_t nv_temp_target_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", asus->nv_temp_target); +} +static DEVICE_ATTR_RW(nv_temp_target); =20 /* Battery ***************************************************************= *****/ =20 @@ -4295,19 +4364,19 @@ static umode_t asus_sysfs_is_visible(struct kobject= *kobj, else if (attr =3D=3D &dev_attr_throttle_thermal_policy.attr) ok =3D asus->throttle_thermal_policy_available; else if (attr =3D=3D &dev_attr_ppt_pl2_sppt.attr) - ok =3D asus->ppt_pl2_sppt_available; + devid =3D ASUS_WMI_DEVID_PPT_PL2_SPPT; else if (attr =3D=3D &dev_attr_ppt_pl1_spl.attr) - ok =3D asus->ppt_pl1_spl_available; + devid =3D ASUS_WMI_DEVID_PPT_PL1_SPL; else if (attr =3D=3D &dev_attr_ppt_fppt.attr) - ok =3D asus->ppt_fppt_available; + devid =3D ASUS_WMI_DEVID_PPT_FPPT; else if (attr =3D=3D &dev_attr_ppt_apu_sppt.attr) - ok =3D asus->ppt_apu_sppt_available; + devid =3D ASUS_WMI_DEVID_PPT_APU_SPPT; else if (attr =3D=3D &dev_attr_ppt_platform_sppt.attr) - ok =3D asus->ppt_plat_sppt_available; + devid =3D ASUS_WMI_DEVID_PPT_PLAT_SPPT; else if (attr =3D=3D &dev_attr_nv_dynamic_boost.attr) - ok =3D asus->nv_dyn_boost_available; + devid =3D ASUS_WMI_DEVID_NV_DYN_BOOST; else if (attr =3D=3D &dev_attr_nv_temp_target.attr) - ok =3D asus->nv_temp_tgt_available; + devid =3D ASUS_WMI_DEVID_NV_THERM_TARGET; else if (attr =3D=3D &dev_attr_boot_sound.attr) devid =3D ASUS_WMI_DEVID_BOOT_SOUND; else if (attr =3D=3D &dev_attr_panel_od.attr) @@ -4553,18 +4622,20 @@ static int asus_wmi_add(struct platform_device *pde= v) if (err) goto fail_platform; =20 + /* ensure defaults for tunables */ + asus->ppt_pl2_sppt =3D 5; + asus->ppt_pl1_spl =3D 5; + asus->ppt_apu_sppt =3D 5; + asus->ppt_platform_sppt =3D 5; + asus->ppt_fppt =3D 5; + asus->nv_dynamic_boost =3D 5; + asus->nv_temp_target =3D 75; + asus->charge_mode_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_CHARGE_MODE); asus->egpu_enable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_EGPU); asus->egpu_connect_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_EGPU_CONNECTED); asus->dgpu_disable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_DGPU); asus->kbd_rgb_state_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_= DEVID_TUF_RGB_STATE); - asus->ppt_pl2_sppt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_PPT_PL2_SPPT); - asus->ppt_pl1_spl_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_PPT_PL1_SPL); - asus->ppt_fppt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID= _PPT_FPPT); - asus->ppt_apu_sppt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_PPT_APU_SPPT); - asus->ppt_plat_sppt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_= DEVID_PPT_PLAT_SPPT); - asus->nv_dyn_boost_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_NV_DYN_BOOST); - asus->nv_temp_tgt_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_NV_THERM_TARGET); asus->panel_overdrive_available =3D asus_wmi_dev_is_present(asus, ASUS_WM= I_DEVID_PANEL_OD); asus->ally_mcu_usb_switch =3D acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSE= E) && dmi_match(DMI_BOARD_NAME, "RC71L"); --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfhigh8-smtp.messagingengine.com (wfhigh8-smtp.messagingengine.com [64.147.123.159]) (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 730A914290; Thu, 4 Apr 2024 00:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189852; cv=none; b=eZjllGyCaJM4ci4OzZjJumCmCPG48xukglZcBR2iN/2c2ri0XHwXPntShVSj5kzG6KLX1L0wj0DJt0E2zvgViPe0OZLWlV9RPvpKRCMzn4Bloj3vopyhEp5uKB0gdQqS825npuLYduBff4gdTmReoXmnUfjEwteSKq7QdPU4Cc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189852; c=relaxed/simple; bh=l+urmTucqsDaN1OqRf60e72kkzCF9DKrlY4Vt9xB01s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Qb1hheZYYiX3Jf4deFPtnVKGOKMm73g7xErXcxx+Fp0Q/Hjgpj5K/OrIViQZWu1ojmbwSbtE4xKmsfMKfmoeKsvWcw42wXylMHHFcAtk8B8zNBMfjpyGJRvxV/MXwwFQchdbyH9IOSCBibm4K9cgPTbmj2eisSZVT8Gf868gmQc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=llwp11bv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JJ3U6K1D; arc=none smtp.client-ip=64.147.123.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="llwp11bv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JJ3U6K1D" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 9D9B518000C8; Wed, 3 Apr 2024 20:17:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2024 20:17:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189849; x=1712276249; bh=52HgFVs0jtkjYiVKyD0T+9/xaIFl0PeY3ojaOnzkf3U=; b= llwp11bvQVe0Q4ypNXQTg2xTA9fnYvLvMMyTx7r0i4OfOpLv3Acas9E6D65QCteW PvwqOkghc8e07odrk1yjaws4Sj7j1OnHivkvj8dHpoiCaVFEChsGAXbx2GrNMz9l w1OwmHrl5H3aMcPKbde4SARSRY53anzO3QEJ4TfcBMdcoZLRypC+OlDF2UlZbYMs xnVVU4zqx2uU1QHskPwBe44Z40PDB8zbkoqWBLv7u8SFrfVZKuoZzSC6/1qQfxt7 daSGcYCgXFJXzQoJD8SlPvJKTXkvEvsG2fqVX4vEmNm9C09LU0OKYqx3AMl4zXvg 4yNdmBhmnEEsYikP5zpLSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189849; x= 1712276249; bh=52HgFVs0jtkjYiVKyD0T+9/xaIFl0PeY3ojaOnzkf3U=; b=J J3U6K1DKOaTHXD/VTq2bZo6FslQGCEV7OMiWQfas9KPXOLUdzvd8xIYcoCOXDX+p qotP+qzT+4nASmvXVeW7TD4Lg6y4tnTAg5Nh1qhfAz0vb+6+KTe91I9I3pHssGmd +4BVLckK2/YhGxEOd1smNoqGouweVhbJXoAQFaOOZObeFs1j0utm9krdnyupYVxB 2P6LiSYwvq+2rh/nKayEigKRpU5arNf76qlDR6LFrH8vSImazRipnDq92YIeVG5m duvh6JKJy2KKLO6NSsWUmH2q55hLknf+KBIJFhSD/G1KAQLlD7mK8RD3uBJ7QXQf JTTwk3VEadW7JdPt77wig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpeef necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:26 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 6/9] platform/x86: asus-wmi: adjust formatting of ppt-() functions Date: Thu, 4 Apr 2024 13:16:49 +1300 Message-ID: <20240404001652.86207-7-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Shift the call to dev_get_drvdata() up to top of the function block in all of the ppt_() functions as part of a minor cleanup. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index f13606fc62e6..976e26c82f80 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1008,11 +1008,10 @@ static ssize_t ppt_pl2_sppt_store(struct device *de= v, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); int result, err; u32 value; =20 - struct asus_wmi *asus =3D dev_get_drvdata(dev); - result =3D kstrtou32(buf, 10, &value); if (result) return result; @@ -1052,11 +1051,10 @@ static ssize_t ppt_pl1_spl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); int result, err; u32 value; =20 - struct asus_wmi *asus =3D dev_get_drvdata(dev); - result =3D kstrtou32(buf, 10, &value); if (result) return result; @@ -1095,11 +1093,10 @@ static ssize_t ppt_fppt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); int result, err; u32 value; =20 - struct asus_wmi *asus =3D dev_get_drvdata(dev); - result =3D kstrtou32(buf, 10, &value); if (result) return result; @@ -1139,11 +1136,10 @@ static ssize_t ppt_apu_sppt_store(struct device *de= v, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); int result, err; u32 value; =20 - struct asus_wmi *asus =3D dev_get_drvdata(dev); - result =3D kstrtou32(buf, 10, &value); if (result) return result; @@ -1183,11 +1179,10 @@ static ssize_t ppt_platform_sppt_store(struct devic= e *dev, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); int result, err; u32 value; =20 - struct asus_wmi *asus =3D dev_get_drvdata(dev); - result =3D kstrtou32(buf, 10, &value); if (result) return result; @@ -1227,11 +1222,10 @@ static ssize_t nv_dynamic_boost_store(struct device= *dev, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); int result, err; u32 value; =20 - struct asus_wmi *asus =3D dev_get_drvdata(dev); - result =3D kstrtou32(buf, 10, &value); if (result) return result; @@ -1271,11 +1265,10 @@ static ssize_t nv_temp_target_store(struct device *= dev, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus =3D dev_get_drvdata(dev); int result, err; u32 value; =20 - struct asus_wmi *asus =3D dev_get_drvdata(dev); - result =3D kstrtou32(buf, 10, &value); if (result) return result; --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfout8-smtp.messagingengine.com (wfout8-smtp.messagingengine.com [64.147.123.151]) (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 122AF1803E; Thu, 4 Apr 2024 00:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189856; cv=none; b=tC5CQDB0vHD6IyeLjmGQr68pt68PA/BY9GOdR0VIKMc25gTy6hfMLx8vGqSowjat6nt2D1Iv/UzbOIOxZcFSbCWTGp2A4ATdMCnE19PpPN36ySPaSNZ8aMlXSQTFOOk5WiXXU2xeOS8bOBQKhkn+qC3DfU5Wha58CbgJA25gYH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189856; c=relaxed/simple; bh=4dW61Zig4zT7R6fjqVWWAri0VvDtQDJzyzbMJqLhgt4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oZeNP16kdZlaVBAnv55CvanhR/E/XdyxzcbZRWDE6pK+rLS4VNX8HgcVyXmuM5CoQj7u7lsMRibXsU9C4ImmXcGs+WR8yfeyCrVvYGZ85N3flG55Wq6JQNkXii4GrUdUvsZnNDPu9PAxG5/JZFXzFF+THuihGDDI5Z93QW7rMvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=A4qjjqs2; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=DEwphbKy; arc=none smtp.client-ip=64.147.123.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="A4qjjqs2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="DEwphbKy" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id DAB7C1C000F7; Wed, 3 Apr 2024 20:17:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 03 Apr 2024 20:17:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189853; x=1712276253; bh=SZxOjOhPVblOzmiWhEFz3xhjvExM3YdMig0MEady1SQ=; b= A4qjjqs2z79MdL1/+nEIJ9zYcfQhUgaIUHja24q0v1C1mXmO89iODqoBQrqXA6yW UePhLiDu9ec73jg8iEj84TzHkXJJlEyzPyXbYxtxt6ANgM8ArCnEDMt75kQpex0J GdwoI1RAoko5lZ/krdBJ3NHqf4NDHR3XwltFVwG+V/2xb1IarPyk91XuuWaJVeTv qh+fH/nxrxNO/oTE0Um/wJQRkMo+B7rugemhnRaQoy6dy21YFRPtBU+pbM7Vrs77 Ml0qRj+AIXFzll5wrrYXnZ9S+J+G4KFqCnVkjyqKlT4pbfwe2rV4o7xb6qS9pJso J7qR09A6N31jdKAQhvG7vg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189853; x= 1712276253; bh=SZxOjOhPVblOzmiWhEFz3xhjvExM3YdMig0MEady1SQ=; b=D EwphbKy9KWelqsn+5GQCk2l6ncyz93Iy4V2Y0xyR0HXVvufo2QFUq6ittRWxbu6o I1HUKTYu3h5npzLV1C5fVpQoM1tKL7Zmx2Tlg1LYJhI5ULh4mtRWXDB4PccHbWvA k9zgVXXMf5yMYzeGzt6tb/p2deSdcDcG1aytlsJiievLK3hVfIJvwMwDRPU9y+sD 0NJVze4Urcdq/nsLsMfQuxweP2Unls/Atkh4CcgrYnGmxKZokZyvTukWGHdUPyKl EoOd5DsBBT9u+bw6j2QjCwOj+fBMN4poEhYkL0ERrG1d9YiNzEeWqTU2AnTV6Tj3 MQNnAtEniwn0A8BnbPPMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedu necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:30 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 7/9] platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU powersave Date: Thu, 4 Apr 2024 13:16:50 +1300 Message-ID: <20240404001652.86207-8-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The previous work to allow the MCU to be resumed correctly after sleep and resume tried to take the shortest possible time. However as work continues in various other parts of the s2idle subsystems it has shown that it wasn't entirely reliable. If the MCU disable/enable call is done correctly the MCU fully removes its USB endpoints, and this shows as a full USB device reconnection on resume. When we tried to short this as much as possible sometimes the MCU doesn't get to complete what it needs to do before going to low-power and this affected the reconnection. Through trial it is found that the minimum time required is approx 1200ms to allow a proper disconnect and disable, and the same amount of time on resume is required to prevent a rapid disconnect/reconnect happening on seemingly random occasions. To be safe the time is now 1500ms for msleep. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index 976e26c82f80..ab98f91e573c 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -140,7 +140,7 @@ module_param(fnlock_default, bool, 0444); /* Controls the power state of the USB0 hub on ROG Ally which input is on = */ #define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE" /* 300ms so far seems to produce a reliable result on AC and battery */ -#define ASUS_USB0_PWR_EC0_CSEE_WAIT 300 +#define ASUS_USB0_PWR_EC0_CSEE_WAIT 1500 =20 static const char * const ashs_ids[] =3D { "ATK4001", "ATK4002", NULL }; =20 @@ -4829,6 +4829,7 @@ static int asus_hotk_resume_early(struct device *devi= ce) struct asus_wmi *asus =3D dev_get_drvdata(device); =20 if (asus->ally_mcu_usb_switch) { + /* sleep required to prevent USB0 being yanked then reappearing rapidly = */ if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE= , 0xB8))) dev_err(device, "ROG Ally MCU failed to connect USB dev\n"); else @@ -4840,17 +4841,8 @@ static int asus_hotk_resume_early(struct device *dev= ice) static int asus_hotk_prepare(struct device *device) { struct asus_wmi *asus =3D dev_get_drvdata(device); - int result, err; =20 if (asus->ally_mcu_usb_switch) { - /* When powersave is enabled it causes many issues with resume of USB hu= b */ - result =3D asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MCU_POWERSA= VE); - if (result =3D=3D 1) { - dev_warn(device, "MCU powersave enabled, disabling to prevent resume is= sues"); - err =3D asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, 0, &result); - if (err || result !=3D 1) - dev_err(device, "Failed to set MCU powersave mode: %d\n", err); - } /* sleep required to ensure USB0 is disabled before sleep continues */ if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE= , 0xB7))) dev_err(device, "ROG Ally MCU failed to disconnect USB dev\n"); --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfhigh8-smtp.messagingengine.com (wfhigh8-smtp.messagingengine.com [64.147.123.159]) (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 781BB1B800; Thu, 4 Apr 2024 00:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189860; cv=none; b=TlcD+OFmdwKRfGZaNu4zh/eNY8F5MS42pKVG+UU31EK7lC6Nf9yt/fA+3kW3QJfYH6aD5EBaUANrr81h6x4OV+4fiDtTB8RSgMRuHYdO5xgJoQLALLGcwQYOy4sGanNDqwknVuELwVI8eAKsk/FYe3kv3uWJry+OphgEutQ9Czg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189860; c=relaxed/simple; bh=RigxiSjgWoFftuq3+PU0L2MA0yigmESUDun1HkWLGKg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SorWKfrbqPu/2ZEFGSh5lmFVsZP8wIEuHi2MSFATHOVTAlBgCOiWpcRv2M7t35EIalvE3Z5yjVd0yti19rjsQMVDSbStMKQpCit3RNVZH9kyGDhlV+fAziD2KtdeHE9bP9oS1+PnsKcIXlKcaKRRJNNukp4gvgnWaKwzmHqxJsg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=Tq/5Wc95; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=SNWUhbXI; arc=none smtp.client-ip=64.147.123.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="Tq/5Wc95"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="SNWUhbXI" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 2E0BD18000FB; Wed, 3 Apr 2024 20:17:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 03 Apr 2024 20:17:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189857; x=1712276257; bh=7Az00aewtRWp5Y61/pH0rVHkKLXtEg51elHeqTyC75w=; b= Tq/5Wc95MFpvgByIlowrxezmgZ8xzqgxUyvGzRfBDOn6PwhyLOsoTzfCTRR1Z537 xEU3Oij3S73L6a4R1h7GfElwNkfkY02tb6kE9NSs352IwCMPzXaS3MPg4mKJDbNR bB6UrfOETP1A8k2sQf+IFJEL1x1nZspQsPTgd03Oa9J7OsV6Aniia+R8I529BpLC O7+ebci/LfBMXx/TTfvFVmYv+R2hPlqNxuaSAAXsRVYYEpcUm/hMlVmR61IYY34P eA3cBjOBlwit4SpAZUZjeSXITf2Pr4WKrzGAqWHwHNK0fQnI1t3bfzKO6wuuzHad 2lF7CUMAlXD0j8rrEQhLTQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189857; x= 1712276257; bh=7Az00aewtRWp5Y61/pH0rVHkKLXtEg51elHeqTyC75w=; b=S NWUhbXIYF66PiJMfzUa6HbmSwjR9GFZRk74fL79TCxCGsYjNfe5bfL4/oihBf+ye OaE4r8uQjzCREeXSagHGX/Y13rNhZMg9YG/1paD1jfbk3iaTNkRCXJvETKW7SBT3 ELtXceV9dEh9JG8gt1WrBgilGUe/g4KHNje7FMLGjnWcCyvC4vzMNmcfTN6UNc0X won02uik0FORX+nrWPEJvaj7AaPlb5IULXDGyCND6C2fLoq43FCI2pNhaJPf3mYm JRScBwm4txHmaO0T6nUAdXqX27zC2k2NYdyiWdDIgL9ufils94wh//SskAftgN9G 3RK1FJxi0c0ma60Udw1og== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:34 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 8/9] platform/x86: asus-wmi: Add support for MCU powersave Date: Thu, 4 Apr 2024 13:16:51 +1300 Message-ID: <20240404001652.86207-9-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add support for an MCU powersave WMI call. This is intended to set the MCU in to a low-power mode when sleeping. This mode can cut sleep power use by around half. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- .../ABI/testing/sysfs-platform-asus-wmi | 9 ++++ drivers/platform/x86/asus-wmi.c | 50 +++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentat= ion/ABI/testing/sysfs-platform-asus-wmi index 72933527d2e4..28144371a0f1 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-wmi +++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi @@ -203,3 +203,12 @@ Description: Set if the BIOS POST sound is played on boot. * 0 - False, * 1 - True + +What: /sys/devices/platform//mcu_powersave +Date: Apr 2024 +KernelVersion: 6.10 +Contact: "Luke Jones" +Description: + Set if the MCU can go in to low-power mode on system sleep + * 0 - False, + * 1 - True diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index ab98f91e573c..d06d9e0c498c 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1303,6 +1303,53 @@ static ssize_t nv_temp_target_show(struct device *de= v, } static DEVICE_ATTR_RW(nv_temp_target); =20 +/* Ally MCU Powersave ****************************************************= ****/ +static ssize_t mcu_powersave_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct asus_wmi *asus =3D dev_get_drvdata(dev); + int result; + + result =3D asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MCU_POWERSAV= E); + if (result < 0) + return result; + + return sysfs_emit(buf, "%d\n", result); +} + +static ssize_t mcu_powersave_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + int result, err; + u32 enable; + + struct asus_wmi *asus =3D dev_get_drvdata(dev); + + result =3D kstrtou32(buf, 10, &enable); + if (result) + return result; + + if (enable > 1) + return -EINVAL; + + err =3D asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, enable, &resu= lt); + if (err) { + pr_warn("Failed to set MCU powersave: %d\n", err); + return err; + } + + if (result > 1) { + pr_warn("Failed to set MCU powersave (result): 0x%x\n", result); + return -EIO; + } + + sysfs_notify(&asus->platform_device->dev.kobj, NULL, "mcu_powersave"); + + return count; +} +static DEVICE_ATTR_RW(mcu_powersave); + /* Battery ***************************************************************= *****/ =20 /* The battery maximum charging percentage */ @@ -4317,6 +4364,7 @@ static struct attribute *platform_attributes[] =3D { &dev_attr_ppt_platform_sppt.attr, &dev_attr_nv_dynamic_boost.attr, &dev_attr_nv_temp_target.attr, + &dev_attr_mcu_powersave.attr, &dev_attr_boot_sound.attr, &dev_attr_panel_od.attr, &dev_attr_mini_led_mode.attr, @@ -4370,6 +4418,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *= kobj, devid =3D ASUS_WMI_DEVID_NV_DYN_BOOST; else if (attr =3D=3D &dev_attr_nv_temp_target.attr) devid =3D ASUS_WMI_DEVID_NV_THERM_TARGET; + else if (attr =3D=3D &dev_attr_mcu_powersave.attr) + devid =3D ASUS_WMI_DEVID_MCU_POWERSAVE; else if (attr =3D=3D &dev_attr_boot_sound.attr) devid =3D ASUS_WMI_DEVID_BOOT_SOUND; else if (attr =3D=3D &dev_attr_panel_od.attr) --=20 2.44.0 From nobody Sat Feb 7 08:44:04 2026 Received: from wfhigh8-smtp.messagingengine.com (wfhigh8-smtp.messagingengine.com [64.147.123.159]) (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 B02D31C6A4; Thu, 4 Apr 2024 00:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189865; cv=none; b=OkVbzq6Nd44v2IIUDgIEdwv50X+030lLzxgYbMXehcTwSwL0jTIR7OB9uJVsUXrBg0Ce4Bu9ki2gdnSybgwOJrZ27kz5mBQxXwwEWkCkAFjQSqCdtb3Db1zmIeFB2hNvHDpcNoMPsJmyrjHvJCDITHcjwv9WjFCamxCX4WVskgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189865; c=relaxed/simple; bh=VKZYrJDBI4Tg+jJYZ5tYzIFr1wEKASSqze+TdUIUhYw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rKoQtGIL8RE4zqrMGPfy8Qh1AJ4D2J7SFtJF2wFUhfyU/BqqWhmq0eU/Db7yQMxyRD38RGzCcww6vJGfQRYPTByey5MD3s0XfPIDM/iLCLpLzVVoe2dGMfPcI/3dakneFKwy2BgPimabrvg/YdDbP+kW2gVfZUo5Bm+qyRA8NLE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=vhfJmPvq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=axl4b+IU; arc=none smtp.client-ip=64.147.123.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="vhfJmPvq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="axl4b+IU" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 9BD9E18000DD; Wed, 3 Apr 2024 20:17:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2024 20:17:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189862; x=1712276262; bh=SWwR8iaMb1pyiVmb4GJOb8En73DRDg4SXGzGWsHKjIM=; b= vhfJmPvqCkuxfiRTB7SAkmwQZsqAmMy+0MBdSWJIsi2PSAErVqv9QKaXHbGEmA2j fAVAfGfehC1vZY2WBm99ll/l4b6ctE1BUHljSOdhxWM0bd3FOUCLfUOA8Jp3ev96 7C4oJMV3APOB5dE2gogV4/x0awN/7Azds3laYV95aTF5K/ULy4h4EjxuoypmD1E0 cndgtbzgnpvVe1jTcnBcJEXI3SEUqtFli1AVBl/gqyQHLWBz7uu0/62NX1tDanQu 7WM9IFqvlPqtEttmgZ9/BDveZuyWXxT/Zvyjdf7xmTbW4qKs82Qlji0u234i18Om hommiemUKWmVp8aFpIzThA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189862; x= 1712276262; bh=SWwR8iaMb1pyiVmb4GJOb8En73DRDg4SXGzGWsHKjIM=; b=a xl4b+IUtOsntKPlOEqzUBQZkulhzXdZrQTLU8RYX9Z1vIql/L4FWEC1nHBtmPfOD OjGfwh9KMfM+j0tDfCAyI5iji0fO31BRQNHvZzA7r1kbCwLDW1dbcuFgrdxwsNNK Zv2zS/+e+7GOjl51DvjVaDW+4U+jUWrsRuCRnOgki5jNPrl0VV/3MVt8nL6X7cLG 20cDbPIwv5JoPg5yG/egqknAKsnD4tGdmrT/DPynChp6se+KJU3OT3oe1BXMuqbJ 6kyrmMjOYKf5Q8qW0PTAypwnh28EspThfLOeoiWbyMBIv0TZLjFUXD5CfJJEjbPE xrhIkzkFEvMmsHzqRkJzQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpeeg necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:39 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 9/9] platform/x86: asus-wmi: cleanup main struct to avoid some holes Date: Thu, 4 Apr 2024 13:16:52 +1300 Message-ID: <20240404001652.86207-10-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reorganises some attr-available calls to remove a few unrequired booleans in the main driver struct which combined with some reorganisation prevents a series of large holes seen with pahole. Reviewed-by: Ilpo J=C3=A4rvinen Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wm= i.c index d06d9e0c498c..2d2b4eca7fd8 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -254,6 +254,9 @@ struct asus_wmi { u32 tablet_switch_dev_id; bool tablet_switch_inverted; =20 + /* The ROG Ally device requires the MCU USB device be disconnected before= suspend */ + bool ally_mcu_usb_switch; + enum fan_type fan_type; enum fan_type gpu_fan_type; enum fan_type mid_fan_type; @@ -266,9 +269,7 @@ struct asus_wmi { u8 fan_boost_mode_mask; u8 fan_boost_mode; =20 - bool charge_mode_available; bool egpu_enable_available; - bool egpu_connect_available; bool dgpu_disable_available; u32 gpu_mux_dev; =20 @@ -309,9 +310,6 @@ struct asus_wmi { =20 bool fnlock_locked; =20 - /* The ROG Ally device requires the MCU USB device be disconnected before= suspend */ - bool ally_mcu_usb_switch; - struct asus_wmi_debug debug; =20 struct asus_wmi_driver *driver; @@ -4391,11 +4389,11 @@ static umode_t asus_sysfs_is_visible(struct kobject= *kobj, else if (attr =3D=3D &dev_attr_als_enable.attr) devid =3D ASUS_WMI_DEVID_ALS_ENABLE; else if (attr =3D=3D &dev_attr_charge_mode.attr) - ok =3D asus->charge_mode_available; + devid =3D ASUS_WMI_DEVID_CHARGE_MODE; else if (attr =3D=3D &dev_attr_egpu_enable.attr) ok =3D asus->egpu_enable_available; else if (attr =3D=3D &dev_attr_egpu_connected.attr) - ok =3D asus->egpu_connect_available; + devid =3D ASUS_WMI_DEVID_EGPU_CONNECTED; else if (attr =3D=3D &dev_attr_dgpu_disable.attr) ok =3D asus->dgpu_disable_available; else if (attr =3D=3D &dev_attr_gpu_mux_mode.attr) @@ -4423,7 +4421,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *= kobj, else if (attr =3D=3D &dev_attr_boot_sound.attr) devid =3D ASUS_WMI_DEVID_BOOT_SOUND; else if (attr =3D=3D &dev_attr_panel_od.attr) - ok =3D asus->panel_overdrive_available; + devid =3D ASUS_WMI_DEVID_PANEL_OD; else if (attr =3D=3D &dev_attr_mini_led_mode.attr) ok =3D asus->mini_led_dev_id !=3D 0; else if (attr =3D=3D &dev_attr_available_mini_led_mode.attr) @@ -4674,12 +4672,9 @@ static int asus_wmi_add(struct platform_device *pdev) asus->nv_dynamic_boost =3D 5; asus->nv_temp_target =3D 75; =20 - asus->charge_mode_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_CHARGE_MODE); asus->egpu_enable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_DE= VID_EGPU); - asus->egpu_connect_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_EGPU_CONNECTED); asus->dgpu_disable_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_D= EVID_DGPU); asus->kbd_rgb_state_available =3D asus_wmi_dev_is_present(asus, ASUS_WMI_= DEVID_TUF_RGB_STATE); - asus->panel_overdrive_available =3D asus_wmi_dev_is_present(asus, ASUS_WM= I_DEVID_PANEL_OD); asus->ally_mcu_usb_switch =3D acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSE= E) && dmi_match(DMI_BOARD_NAME, "RC71L"); =20 --=20 2.44.0