From nobody Mon Feb 9 20:59:03 2026 Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (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 9830F46BA; Wed, 3 Apr 2024 00:29:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104173; cv=none; b=XDT2NAdJQ1a7KLvFFgwfQHjpmzZVCB95htFdpvGIKNzPEjMzstKT8dYleBwpcop/1hDxVL9x8NLImbA1HRugDe7uR1RZSwXPa6IUDAe39wDcZppI4vKCiua1B+w6D8vLAHZKr8ENvW2RG3IHq8loGpRTknmkHQLZiG0ZpBuZ6z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104173; c=relaxed/simple; bh=e0k9J/MM1+U2kUahxPM9dv3uvIxGsbiWzykNjAHeu1M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DP1Qap6RTnC3S6PPqKwRM9Zj1ddw/waNEN8bjpOqEXeUe6eWY2d6e+wnvLaun2EX8hULx7syyyvVF/2Ery9cnZIV1KJi5gp1T+6k5lurowtiZT2xWgQOE/sQ/d4/fgvFJ22rVPsK+wywzAPloomoZwF/LwpTc8g3K/3zrpAJdWg= 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=wIJXRJoC; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=IqvsUE6Z; arc=none smtp.client-ip=103.168.172.145 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="wIJXRJoC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="IqvsUE6Z" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id A83B613800CF; Tue, 2 Apr 2024 20:29:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 02 Apr 2024 20:29:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding: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=1712104170; x= 1712190570; bh=E8dn53vhhorz7U2nBrV/MbaHN4fcVu1avvy6C1XYjvU=; b=w IJXRJoCF3AK1zt03pA04YsrQr69OQOH3cBQTPfLZhNWskwo3/tnkhqgcHm7qE0e7 cRU9M1EMW562ML4wI/hc31c6RXAQCWuzmXWMx9P6yRy1p9XuScH7Qi1jMyM00anm kKLCnmlqMaZ3IhprQ7OaABspsHVjLeu1KznEXU+EzLhL1ZpQEpYB+uCxagoiEMbO 3R/jmAGvG0oLPJSHjy5LwTXxmawn+0mSnPghiPAljSahfXek/3BvAYQwt1kOxyaL U8qdo6n2E4bjktKGC8VftQ7y4u2LGl/i1j9TGqzqBjsM934TFVMGZbbysoIKlyXe WIb1TPp5teiNPFFHfrHYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1712104170; x= 1712190570; bh=E8dn53vhhorz7U2nBrV/MbaHN4fcVu1avvy6C1XYjvU=; b=I qvsUE6ZfWfhmEl/2/xr+Bx6eSxiT8/gdju5IA9xqRNrydLGbhjur1dH8j/Nc94zZ M+ZDn0DWiqLwjectppS3DYETyj26/r5xsgirQaEci6+EwzMZwSoZWT1fMmSKIABl 4IgrpiYSHcuJYu4ZiYyouhpdrxwQ2H+oRZNviCAQN09Mubau/W6+VYPf32h7AOl8 1BAZ4A87JDwoK5p6oK4BEX40c5fwcdIYKhEid7TKOtTP5jwEYxHj8s/YdJ5kj9Na HSafbNDzAGCej9SKHl0BLO3QQJA7RDC4l3Da4A8C2dl1kZ08aVKMo779fAZreNhK VieUOACCBdtvd31mqWklw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29:27 -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 v3 1/9] platform/x86: asus-wmi: add support for 2024 ROG Mini-LED Date: Wed, 3 Apr 2024 13:29:09 +1300 Message-ID: <20240403002917.2870959-2-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. signed-off-by: Luke D. Jones Reviewed-by: Ilpo J=C3=A4rvinen --- .../ABI/testing/sysfs-platform-asus-wmi | 8 ++ drivers/platform/x86/asus-wmi.c | 94 +++++++++++++++++-- include/linux/platform_data/x86/asus-wmi.h | 1 + 3 files changed, 93 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..588c099103de 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; + int err; + u32 value; =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,30 @@ static ssize_t mini_led_mode_store(struct device *d= ev, if (result) return result; =20 - if (mode > 1) + if (mode > 1 && asus->mini_led_dev_id =3D=3D ASUS_WMI_DEVID_MINI_LED_MODE) + return -EINVAL; + if (mode > 2 && asus->mini_led_dev_id =3D=3D ASUS_WMI_DEVID_MINI_LED_MODE= 2) 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 +2201,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 +4206,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 +4259,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 +4514,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 Mon Feb 9 20:59:03 2026 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 4ADB6BA20; Wed, 3 Apr 2024 00:29:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104175; cv=none; b=eEnPcyOCZ4XdNoTMZQfq2B4FBdLgcnLqex4zUY92Om/rE2SgwsnyDw0Rck1eBTSAz0KPyLhQPMWyKrZeNB/8oSza1IK/mqaCRfA7j0pVTl9z8fRhzBe/N50Ba+z6OevZRP3sSbrJsYMRhifnbIZyAX4Il3X/sr0aXD3vIVyXatM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104175; c=relaxed/simple; bh=GzuvuOvws/RzzTJJXSZCAEGLMvlQ71NBop7ZeG+pCF4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tmJXokcovK38VB3llqGsuIsOp4ZWqcZ9b4gonTIPC1+SppAivRgHTzrSiGxSZes06ooaS1Vg3kcm/TpFdlqORT1k1wpHb9m5mpEcbfPPqkXKR28n3rpORhDOz6nQehKl/RFpe8iRdHtKYLi42K9Kch5djzfBuqOXBYGkUEludb4= 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=f9smeFMq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kId7om7H; arc=none smtp.client-ip=103.168.172.156 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="f9smeFMq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kId7om7H" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 68328114010D; Tue, 2 Apr 2024 20:29:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 02 Apr 2024 20:29:33 -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=1712104173; x=1712190573; bh=P5LXGlefIOM49fPBmsSM3dL394MZfKo71EIHeY4AXcs=; b= f9smeFMqzAFInwL/TVZCkvF88NRsXWhB3BUprSfpmMZDYqRTo4tp6GP74loHCVkj VWkA8NzQ2SDe7s/BJtPHyt3czjf3/Tk/n+fNnkZFzwzlj4xReN7qQxDHhIqy3uS9 67k/W3td1McZSYtiGDjGsF8hjr8t5+2CRpqpWuFmoWpfC6QUP1RuVpFU5ICK9P9l 1jA6WzO52rgBzGUI9n+QEuo7XOtvfSN5FmTPpluC2Y8dpNJ7wPD/wQpRwDghzMyp crwjPl3ggM2ZSrD9X5eGrcwY3PA8kWvmSPfYje7BS+GRZjx0RCvabDbQ3EIpvd9Q CjKrPUeS3kjNwI1+cL1GuA== 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=1712104173; x= 1712190573; bh=P5LXGlefIOM49fPBmsSM3dL394MZfKo71EIHeY4AXcs=; b=k Id7om7HUoklf3N3dTIcpcKtOIiMRdmSWCuEFJUShD9AAMVIHk5vaMJRrPq/9TNGq iHU7A5DcLMP4a3Sf4zFDVW0lGBTXy5HBPPXfbvlt16GMnujKQddg8FC0/fEkY74R evez/zLbMltlHA9d4iroD9xdGHlhxAmgw68EYjqTieNr9bDQq2CAHjCjPyafx7Gm e46jpyjhLaJZ/cLx7DS3PVglJr2qjab+GVOBPPwASHYCxczmjj9sbRG4gDU2TKwd 4/yvjqIM458ice4tTA2wvIp79MrxKHo0UdeNH1S+O/2zlRD/n/BgKaj5V1ltVyHU idH83SAI0Vc9tvpNfkcwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29: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 v3 2/9] platform/x86: asus-wmi: add support for Vivobook GPU MUX Date: Wed, 3 Apr 2024 13:29:10 +1300 Message-ID: <20240403002917.2870959-3-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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 588c099103de..7d5990d16b2e 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; @@ -4237,7 +4237,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) @@ -4503,7 +4503,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); @@ -4522,6 +4521,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 Mon Feb 9 20:59:03 2026 Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (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 5DD6610940; Wed, 3 Apr 2024 00:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104179; cv=none; b=jfXua4o1CvHLFnVbU46gR0FKCwV1FcO5Xaxaww/aqTR4KPIWcsf/jawUMkYU4HS2aIdPujhpabUUFoamTpxBNuSe5crIYbV4sps6JUg6qhLKTjBCe2YdJ3cpVYOUwKTvpblUUX5wlrAYns0vXuayoxkSIe8t+ohuiSIO8p0uUtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104179; c=relaxed/simple; bh=QyAaEvEWvdwGHJ6mey1nMDjh83cdeCXThJC2zX5mkmk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u4pSQcyaW1m6TaPycsGae1Y7JyZWedARhn5WV+DzVdPacXdWQ3YczNx0nfw0/GQCMe9c4oSTaqX4xX/A1inOl38BTPJi6jJvS4ILA1HSzuBT54cNPMO2DSIhRzxFdkh4G81ASOCYECYZEcoWcAeH+xZr4rApBoGaegORzeUrpWA= 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=DoWkP3SD; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ReAvqCzh; arc=none smtp.client-ip=103.168.172.145 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="DoWkP3SD"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ReAvqCzh" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 2532B13800CF; Tue, 2 Apr 2024 20:29:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 02 Apr 2024 20:29:36 -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=1712104176; x=1712190576; bh=2fj3thS8y4SJzaCc3D6wE/ySSWe0qGjNLMn7kw6VApU=; b= DoWkP3SDqL5ubw6pnMKmVLx+IZo2EIHAkqcBXmlR+u3pK6KDZ6Vl8kD0b3/fqvz7 rpeLMLZktPoVsbhmvVyOyGEPcVFuMr0I/nu5Od/cCOWDK5oO9T2pac50SiYb645p 60PDAsZA+Np4J4g0bf1M4awxrLISKTAlrJU6iWLJKGA+HptmGoQsefGkXUUgEfhr dQJ3ZKc9Jzxa+jnxKUsS+r3UvR/e5fdBUgcB79m8oBSiXZYPOXWK8s/xCLGXfhCW 5fZ9K9qQrSUQjI5K6OfVNpf45NA/a8gqo+ktfYcmoW+4W5SfGbZd1sPTfFhsVHct fItt86zXZ9t+JXUAqIyKfg== 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=1712104176; x= 1712190576; bh=2fj3thS8y4SJzaCc3D6wE/ySSWe0qGjNLMn7kw6VApU=; b=R eAvqCzhoNKba8avusTI0LuQyOd57diycYuae7Xchsh1wMICKvAY4cCGM78xleoFg cqSTC7sKfYE+VCUCO6rLFEOLBZwKRoinNtCLMeBt2F6qe9LJCNhYgJ2/C/l+LXEd bu46A64EtI0WfXdfNZTz1QNJ2Ksx7cUL6hk0oP47qViWUDdUwCFd4k01/FVAgA6K 59MjX93+BTI8/qKB2yF8mnJZvUmDOdIxMk0YRiortnfZVkjZhZ3eeYe4bp4c3LLR 0jeSnZxsO7hDSFwqQIH8iR51F/bVmIOtFvwAmLD4SPg2sGcOvQVulqHWOJgNNqHx 7cr+OUr9ATMljbCRlEAGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29:33 -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 v3 3/9] platform/x86: asus-wmi: add support variant of TUF RGB Date: Wed, 3 Apr 2024 13:29:11 +1300 Message-ID: <20240403002917.2870959-4-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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 7d5990d16b2e..b6a8b4eefdb3 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; @@ -4503,7 +4504,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); @@ -4526,6 +4526,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 Mon Feb 9 20:59:03 2026 Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (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 EF55915AF1; Wed, 3 Apr 2024 00:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104181; cv=none; b=iNwveyJyqbxQ3yvmDNfJYAFeo5st+F3NZj+aVoO2284bYwMPHl0uPE0Bj75Nnzy/JDvLKRdz7FT/nCF1PE6vgNDWGZG2WMnQqaLXCwRFOCpYEmtQ+4T0mSGFqQ33cBbs/J2ukUVuA6/7PB0G3zrAlce7ZvJgAGLoRilj44JCGr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104181; c=relaxed/simple; bh=cShbs3bJuOgjEwM14fFKjZEJmbP8r0XOXpx8pQHoqog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AAxaW8DAlW26BncgjrrbWpyFpZ80dzUw9qNA3mA5k1lAgBlB1lJlJmmB2uJvZH+r2xCbe4ppTPwLNx3kz52FXMlX87Pc+dFvQJlu0j4iwjPet9sWebYSo+QopheheoIoYLEmFyjBIJMeMZsqa5xsyEVfkB6k40iVErnDq1YzO48= 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=Jiy5zPWJ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=RhXpz0ay; arc=none smtp.client-ip=103.168.172.145 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="Jiy5zPWJ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="RhXpz0ay" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 0E4B213800DA; Tue, 2 Apr 2024 20:29:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 02 Apr 2024 20:29:39 -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=1712104179; x=1712190579; bh=o0/vJqpd9srucno4MRwmA+Fc6L50yGN5H7PaUAexeYc=; b= Jiy5zPWJIPmLNVBtBcbNJl3f1BuvglKIOFW0CU0KJl0TyVZ/pu2xqjoU5mG67son 1XXowSHW8m5gFQ5FWkcdyFw4hc2OKJ5tC+m9nXWtbmk6lO/vdh24G84HkiuPiwmN TXvwtS5Nfbo8G6zLlngZ8BILwDnFQYHaUN1JRvu9D3WlNw6//x+Qs9NyvIY+aO++ lBFNeYbqM+rt+7gL9/zjv9nxyTqC89XeD/+rLKShBEExAWc8YmLoC3FZTL2JQQ6Q PRBDGuCR7CdZEmVObogOw2OsKdtZzeaGISjq89AGzo1HD3dblAZIJPBdjGfyOw5A d73URMowjBglCemHjzncJQ== 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=1712104179; x= 1712190579; bh=o0/vJqpd9srucno4MRwmA+Fc6L50yGN5H7PaUAexeYc=; b=R hXpz0ayu2OpRtGRGr0o1lqgJpRUVHiktxAF2rwaNTnngFrhHrnSijxFlmy8Lf0yp KISbIxJ+SxG+t+Sy/OJHnMAYIOV+ju/+CkCjMHAXe43W+VuWe+yr0+c+vh23Jx69 ka8EIT6NwazkcEI9T6AQtWVbUHT6FWmkGgU1qb+edZe5EOhcDAVozIbYb14EDgoO eD1sti1VuKUUWPRJywEMNpf3yCxfy2K60PSgbYKAiQUx2CPnbwVrmgZroBk3Ag0u YQYortFDqmHTU9Dlqomvy132CvcrucEjdJAi1NdJjucU4nX9twvOKP1mfmbMRt0S Cdtv52hZzv/5aLhRv1JkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29:36 -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 v3 4/9] platform/x86: asus-wmi: support toggling POST sound Date: Wed, 3 Apr 2024 13:29:12 +1300 Message-ID: <20240403002917.2870959-5-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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 b6a8b4eefdb3..3cb907ee07c5 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) @@ -4205,6 +4253,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, @@ -4257,6 +4306,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 Mon Feb 9 20:59:03 2026 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 D902E11190; Wed, 3 Apr 2024 00:29:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104184; cv=none; b=gdhW8MxDSEeEiBTUag1yGcXY2zc7Xu1RnChmm2JS1rsNgssib61SRlQoVYJ3emSq3+022WKQNx/wQ25pUOnLMu1j6aD/oc36NHTY5Iuk+Q8dCEYHKQtrNIPEIOQlXzEfh7PZGSQkQ/6QUwNlZlEKvJYcd8+WMpdJA2+ol8ZPNws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104184; c=relaxed/simple; bh=6joGT/MnG4WsyuQcvBota9A9uM824aIeASCenrmlyBs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EzAnyiWPKm54m3fWAtTBOI+ewzsrKnxQIeScCGmxF2KCpII5CQVfR34gFFZJi+1Ke6C7lQi55zy0cleFWkhmfrUW92BmZYxL+UZ3JZLRPWKXuxxJQr9X1ZVJPjFF4VZm6PDFi/GuErkzP3bGF7so23bM1vcf+/a0yjCq5PWdRR4= 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=aiHyeHH8; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Ihg1p0CM; arc=none smtp.client-ip=103.168.172.156 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="aiHyeHH8"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Ihg1p0CM" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id A871C114010D; Tue, 2 Apr 2024 20:29:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 02 Apr 2024 20:29:41 -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=1712104181; x=1712190581; bh=4gNqh2mr2s6idJ4KEipqBLuE86xIzsFXyfYe+LDV+Hw=; b= aiHyeHH8poXQZHXuDPSy5Qx1LKrJbRq9p6CDma57lW2FxjfZ1rW9aiew4Kbk3gB2 Cr2/+v4Y5uvg+k2xQFXAzEZzpSjDRlcRhvJuqIy6P3q/e/mZM27uvsJBHJPbZlSp hIzFvFTcSRt0KaODFNO8KVlEASEC/AnJzWdSpBXYJXSCCX1oVS9wz2/k6erhjudQ CjZfID3Hh+vaV0vCV43n7v+/GgBeUc1liS6kLJ4+qfWd55EDQ9GT1FA+BZcQNuDS eWvUkUqC4fklh0XWUj/VnWh3GFQrOG7Qj9kkmrC+SC2oAFMQGvuDU6zSnE051VWA xsT2G3y/NxAQDScrFt736g== 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=1712104181; x= 1712190581; bh=4gNqh2mr2s6idJ4KEipqBLuE86xIzsFXyfYe+LDV+Hw=; b=I hg1p0CMYpuXlv08LCbWlIPDM1/b/52Tg6tW/rfYSPYGdjFxUjm1CTBL9fgB28wW3 bkwYfVWyA75t8Kd6KPfghxzUsq+La9AP8emXGOhStPhPo9iUs1w2lwOPipqn1j5L +wjsPc8xdppEbxbjqdlvISeEa6XW4UT9GQL4SRg9XKLQcusWZlGJavL36pJ8Du0s WOVVHa+r268WNQ6dVSt25024VsSb4AdRMRIGnmCqDn4h3sMOhgT+AP8JnxFg6vmQ 7GfioltrUd00Lzku7pKI2sM8xB3VUsR3YjWzvCZ5sKABULY/hTpzjk/akuLXD9e3 ZSDkY6ZsQo4S6QNbBgBfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedu necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29: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 v3 5/9] platform/x86: asus-wmi: store a min default for ppt options Date: Wed, 3 Apr 2024 13:29:13 +1300 Message-ID: <20240403002917.2870959-6-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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 3cb907ee07c5..f87500d87f56 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 @@ -4293,19 +4362,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) @@ -4551,18 +4620,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 Mon Feb 9 20:59:03 2026 Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (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 60C3E199B4; Wed, 3 Apr 2024 00:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104187; cv=none; b=fRhPaF5oz2sRqUnYt+M71JVrzJQbj1jMUHfRqQf7Q3MCSbdzfUDB+sT9mi54VC2aKhHK3nE8hW433NbD882kjYb2zWtf/2ZEkHGsDw0uZK6YQCfzqwJJGyeqi8ldC0a4UpTVhRoegfSb789X4Fw9XGGLIUuCc+M8NsDom94qoIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104187; c=relaxed/simple; bh=NRq9T9dTBGop8ST/HCJTvuOwuOGjuthRTQcwuxHAPBc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FJrYKZLiFVpb0IfgcjEj4yiO3CV6rf4xg/StU4OaZwUwfYsELETjB8VHeFBT+ui55VT6698LgoJvZjjo1mkQSs2ZD0zZGl/ZjxCbgUV38sgLoRUYU9prq3f7x06cLvH3Iv0hEQe5Hw7DIP+L0mrOBNHGMfurgS/Hs1jwsylK5xw= 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=JCXBOTNF; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=TOdPx2VN; arc=none smtp.client-ip=103.168.172.145 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="JCXBOTNF"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TOdPx2VN" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 619F313800D4; Tue, 2 Apr 2024 20:29:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 02 Apr 2024 20:29:44 -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=1712104184; x=1712190584; bh=dcJf/uhZRGW+ikiB54OFQL0MBarFcEONBJk1uxSQBNw=; b= JCXBOTNFLYPRyAj9FGRoLLMsJJdjzU/3uop4Yad6aALyCV6IqV8d/XpfLLNN3z4N 0Uc43J+qInfUCHqvrTTNVrM0hymqK4c+Ah6JYAq8eINqXP5jum+gm5VC67lIKG/D Ra+GlJYVZdX81ccPhI515v/KnSyk+cBLzjnSl456BHtCrUl4ZNLDk33LrSb0AsO1 /Nw/5Hp5vkAi6nnbsQHoxybLjDi+bVRkYJJJgNxfE3NWBCIvS5LDagAbiwrOQBB6 3tEZaHTQOq5zUQgvLQ06c5ZA69TLyhOLISEXPSYdFkPqNi8uOO6jjvlhAdjFpSC5 ecjYYnueemPrFuMKQprlkg== 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=1712104184; x= 1712190584; bh=dcJf/uhZRGW+ikiB54OFQL0MBarFcEONBJk1uxSQBNw=; b=T OdPx2VNJpVSXGLk1kL6Mhzbacel54KdphZW4D1VoQTkRecJnZJT3ob5x+no9Skcg b/WWZFGl+0T4CFvizqrcRaq35/kiEdzCJOMk7nkQuK0JxAqRymBmmXk8yjzcCMl2 5zuKilcbLbTZ5ithZDRx9FBeyQQRwFXC5lP0ar4Xq+RrhAQ+GcPJMKaY2UxSofBl Fd0ugOcfOefgP36Qd9gOJeAmWjP3SrX4tMudk/ErUmZJnog6LY9ObYZW73BJbLZM t3pHCPx3gza2BWSLrTkPyFG2MvPbiEGrvxneD1AdcxwmnfGuVT746JWREekyMMBq dOz1M6koj+dN7kYVT0+EA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedu necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29:41 -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 v3 6/9] platform/x86: asus-wmi: adjust formatting of ppt-() functions Date: Wed, 3 Apr 2024 13:29:14 +1300 Message-ID: <20240403002917.2870959-7-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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 f87500d87f56..aad4f94cfdba 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 Mon Feb 9 20:59:03 2026 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 16D131BC3C; Wed, 3 Apr 2024 00:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104189; cv=none; b=AsxcKbb0Tj8MFTU+3AtzjAhIhPjVu6gcDoNLfpaLPwhqkHPC/xxUCSKWTPFgGFnXBSOV5DpPfRn8vcFSr/E5ArabB+lqcy9O3hFz0k6ZxyyFWcblHrTJP2S1tx+wV7B8lXnRgcOVTjMuaaSHWq5p0IvIJldChC6X6e/JgFR5y6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104189; c=relaxed/simple; bh=hqQcBz8tjJvePBEV24EgLsCD/lpRWZ3kNVG5ktQlrmk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Uyb4vU7jHxQQiDkRA1pIZHo13kQklneUkJbtD8/rHm5JAG8ydq6PYWl07I2G6RxrXQRM4M0Zrwsy+XKIIxIXCb6GoUcTVUhuZbKWUe5ABJrYuM+Ln1nh0hVuzUZDbPHCss67A/nJtBSxcCmE9MjkaUxMndmBMPXVV6c2oeC0amc= 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=RygKvskk; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=GdyOrsZf; arc=none smtp.client-ip=103.168.172.156 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="RygKvskk"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="GdyOrsZf" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 1A8C7114010D; Tue, 2 Apr 2024 20:29:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 02 Apr 2024 20:29:47 -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=1712104187; x=1712190587; bh=WFzsaT48GQrgSEFr3BSkVJlT7btMWqBLkTOeqH2ftUo=; b= RygKvskkKo3VnfRVe3PKHP418GAYUpY6JHezr5vnL8tn29kaktywdQLZ6DO3Ozyn Fkvvw7xsF4VJucUfD0I0hrjQs5oH9bpjWWKrqegqhX2aNhXYmvMR2yPlU3/IamhI yaIOJv8/gTPvaEa889imZXBJxN0ipisMQXWm2iarJYLP3IHtjXl47tJ+3kxCT7Fx kbkIYB9uWEsKCU7s/49plY5Iwa7gRliP8rOci99EtP8OoiC8YfumdS/aEt6YhQYA 8dYawZgIa9FdHrvocFVxQ/2af88I+isxXHQw1K+bnfQtjlpX3liA9nodg2DNfkNE sR+AwNmT/tuvWTPscEzwDA== 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=1712104187; x= 1712190587; bh=WFzsaT48GQrgSEFr3BSkVJlT7btMWqBLkTOeqH2ftUo=; b=G dyOrsZf/6xTZC1yeEHaBpTvMYv/5d8jQJCBb3vNK0GHL24HSW0D5PgF+n3BaojvZ z5+06wG/BXYz7qhMCXwNWM9WKTFw40782EHehJUW4AwPA3D22zUoikF20unKT/BF bHEOh2MMv5ZwPWUhHQNk21wT10h/WFU+PjbNa8t2A5JT30KNbeWnUkxMSaRw46lq Zk+Q5MAmBdc0c/eqZ/JBAxwdqbqkw9WDEEmGUjTJG6V65QKqqsxSpSaLuzuIeFbY ICpUBA3aY8VjxUFdUTlRX4J02jrxkLKh6bWRlzNm1Kvk7R1nbhj3otxBRfffEAG4 78o7t6VVXrrrpdat/0Ecw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpeef necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29:44 -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 v3 7/9] platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU powersave Date: Wed, 3 Apr 2024 13:29:15 +1300 Message-ID: <20240403002917.2870959-8-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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 aad4f94cfdba..7867178a9121 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 @@ -4827,6 +4827,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 @@ -4838,17 +4839,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 Mon Feb 9 20:59:03 2026 Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (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 989651CD04; Wed, 3 Apr 2024 00:29:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104192; cv=none; b=A+mvySOlqvOKk5d9LmNn9ysgoNLqYMSOuSclWRb2nuh0ke0mfGN81oRLbPOJ+ntBqNjEmNRlAviI7lN2VBKvv9p21/JYpyEoDM6Nqs29W4Z1rBJ36cM83AIRx5NMUwAh2CQKgS+LOfMDdx6T30DnVunEqMyM+sjWr8jzLyOqeUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104192; c=relaxed/simple; bh=xDrAjDc6P7boqNQal2P1FLi1EF26TEnE/T12TeB/Hdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q7ajKaV8iD6mwKVpHF6BeVmA6NHcP2dfLm7xRGvfYA7SKNsepYEp7/P/ic7m0iy2mwoFBwFHxzv+BWrcp/UQCBHzmYBdyZi+OsY8X5gbkMHeNzhBKI750LFQb59MdOtfH5q32HHJ/fyjXz7xF5UoPmOYSGlol2Da4Yy9pNIACcQ= 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=lQu5IM7Z; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kBaFskUN; arc=none smtp.client-ip=103.168.172.145 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="lQu5IM7Z"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kBaFskUN" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id C8E0913800CF; Tue, 2 Apr 2024 20:29:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 02 Apr 2024 20:29:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding: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=1712104189; x= 1712190589; bh=RJIIf+Rf3H/UO0CsECc6FASEH4kBHZiMeFi6O+VvvUg=; b=l Qu5IM7ZE/y0+pBsCUuRE2YwIqjMJKfgyVX7pEBKHaod+E147rzk3VvinLMUKUgEV N4SOul3GO2xefZcTko+N4HNALBaOgpZFn9TEHGIuvxVSOXW8VrxxqyXNviWjSz3J RDJrrmzpAyZiNyKrJSSWUgoEwq3VhV9ynVFn7eORNR1hRQgZVSYplcMUyXtynx9x ZbwjGvhMI50GrM6dWcs7RcQZqDUTNoleALn+Xm/mwTiJnOyPRsz2btOpGiUhngrW cLCXhi4zEeIf8bTsRntvYCww9W/LSaA7vxTDzzhpuaoJAaj7QrrQDTCnacoNd8/K ri7F73Bkr5lTelNiAGKAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1712104189; x= 1712190589; bh=RJIIf+Rf3H/UO0CsECc6FASEH4kBHZiMeFi6O+VvvUg=; b=k BaFskUN6IYIeqckO303fCx4F6efki98GsEJTSW/jbkDThehW9yf9DKwxEin4BEws te7Fwx/xY222Y2al+FXtECxsnad8CE2H3llY9K5QzSVU2kwLlmQ0EYB3mhwi8sJz 6NW+jkBppb0nxnIMSzjpF72dj04q106jcLLl5C5x2GQstcI2l876QC53Ojl8jkQv TNK4SiQ5xJy59dE4Hkyiwb3vt4AX5XkXvZT4OoS6t7t9T+kcV4sAoWaW2kCYBMpx j+v21Kk/TqJcCkpNjlt2YY3iJt09ppXWEk2q/zyw2CghVPjhInteD9P3rkimskvR Fz82yOnjdBwCF9gmzL9oQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29:47 -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 v3 8/9] platform/x86: asus-wmi: Add support for MCU powersave Date: Wed, 3 Apr 2024 13:29:16 +1300 Message-ID: <20240403002917.2870959-9-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Luke D. Jones Reviewed-by: Ilpo J=C3=A4rvinen --- .../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 7867178a9121..bf36ac11ad02 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 */ @@ -4315,6 +4362,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, @@ -4368,6 +4416,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 Mon Feb 9 20:59:03 2026 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 6E32226288; Wed, 3 Apr 2024 00:29:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104195; cv=none; b=AWnJJx50hPSeKGaxKK9QZl7V9Gz+IlhouTQ9NI6aJhnC8viM8Vav7sY7msUGFhI7CDOZbdRVXk/COskD7L4xtEAoZ0J9IkyG7U5fmOMA1zUS9MCziaJVbvwD+mb9RvZyEIHlQ4kAaAIEaDYIBQe/2GFCZT0Uxa3snPkCcCYR2A8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712104195; c=relaxed/simple; bh=bCbber1Nyn7koWEB95L7XP5P29hH8vZSiF4GmVJqO+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=igWa6XIsGc/h8d/HqumNDT1867ZMlpcq+DWB+TNlctZHncUVjeRZy4Tmx9zfC9t1Sp/fj1WsVMzCQ08I6kIW9SIjHThJTs0R5pgoEUZSmyOZpohVIZ5IL2vty7IsUYTvnrWu/sqOIVDqQCVp/XBG3Sy3Wj1t5tTsYYATSYDV7ac= 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=iXHwBp3K; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=s71guyJD; arc=none smtp.client-ip=103.168.172.156 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="iXHwBp3K"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="s71guyJD" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 87BE3114010F; Tue, 2 Apr 2024 20:29:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 02 Apr 2024 20:29:52 -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=1712104192; x=1712190592; bh=Z5OnXQIuZf57gwSDw8vHx6pbscFm1+SvEePYmb8TQ8c=; b= iXHwBp3KxsKrpeao5heDGHXtnCB28gVy15OEHdE6dN5vzmfqsGs0l8tQaTwY+T50 pBgdOTYpHzczGGGG71HYowJyUI+wyohJ4VGn4eK1sUBurINzhBPrDzB5gOgNlFG4 H0sTs0C1rOIP8hDGdvuJajS6F9cyUWNrA9I2NuV4YWJITvUaTRuxJXR6McjjlNeB TIiQtxVrhGXPw+xwnyV9Ld52NhQjn1RV8Benm0S5NE1ta3UcDGVLIIoXa8nEZdh8 HKFyU3ORZCqFwIBEWmaMLYHORcrKiSMfhO9VOtF+WLf7izIJ3byqkhmTfPZ8Nwgl gLLcRcFNsTjK4VzWSFCGWw== 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=1712104192; x= 1712190592; bh=Z5OnXQIuZf57gwSDw8vHx6pbscFm1+SvEePYmb8TQ8c=; b=s 71guyJDxRUp2vdXR46slhx/Oa1uIFTxfSe9B7zWD68KWoyu+7X1kMhyVW6jGqrDh jQUNvxMkcHzxfDs9X3Y6pspa+417V3Tv9ZsKSWjLh3jk1HsTsfY/B9n8xZPystdB kQys80JLBKtXpSP4l0wry3GZlzKCNVJMY0pyELePgJrmBBgYQBaTaQWazzs2PIE/ IYFI80IG6pwmtVvqvot8SH4cXLssflF0mIc9kWsGr3UKtFFflds+SLAeu14kgQl2 twb2p0Xb2tV1nWu8oK5WNTt4L48ymf9Jg2TqMc4W4h5TGzWx+t5frRI6KZIrEY0y Y4HlHEJuHxwfzlyaDaLoQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpeeg necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:29:50 -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 v3 9/9] platform/x86: asus-wmi: cleanup main struct to avoid some holes Date: Wed, 3 Apr 2024 13:29:17 +1300 Message-ID: <20240403002917.2870959-10-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403002917.2870959-1-luke@ljones.dev> References: <20240403002917.2870959-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 bf36ac11ad02..b02dcff7d63e 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; @@ -4389,11 +4387,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) @@ -4421,7 +4419,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) @@ -4672,12 +4670,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