Re: [PATCH v5 3/4] alienware-wmi: added platform profile support

From: Ilpo Järvinen
Date: Tue Oct 15 2024 - 04:21:21 EST


On Fri, 11 Oct 2024, Kurt Borja wrote:

> Implements platform profile support for Dell laptops with new WMAX
> thermal interface, present on some Alienware X-Series, Alienware
> M-Series and Dell's G-Series laptops. This implementation supports two
> sets of thermal profile codes, namely *thermal* and *thermal_ustt*, plus
> additional quirk *gmode* for Dell's G-Series laptops.
>
> Signed-off-by: Kurt Borja <kuurtb@xxxxxxxxx>
> ---
> drivers/platform/x86/dell/Kconfig | 1 +
> drivers/platform/x86/dell/alienware-wmi.c | 236 ++++++++++++++++++++++
> 2 files changed, 237 insertions(+)
>
> diff --git a/drivers/platform/x86/dell/Kconfig b/drivers/platform/x86/dell/Kconfig
> index 68a49788a..b06d634cd 100644
> --- a/drivers/platform/x86/dell/Kconfig
> +++ b/drivers/platform/x86/dell/Kconfig
> @@ -21,6 +21,7 @@ config ALIENWARE_WMI
> depends on LEDS_CLASS
> depends on NEW_LEDS
> depends on ACPI_WMI
> + select ACPI_PLATFORM_PROFILE
> help
> This is a driver for controlling Alienware BIOS driven
> features. It exposes an interface for controlling the AlienFX
> diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c
> index b27f3b64c..6e30e9376 100644
> --- a/drivers/platform/x86/dell/alienware-wmi.c
> +++ b/drivers/platform/x86/dell/alienware-wmi.c
> @@ -8,8 +8,11 @@
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> #include <linux/acpi.h>
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> +#include <linux/platform_profile.h>
> #include <linux/dmi.h>
> #include <linux/leds.h>
>
> @@ -25,6 +28,12 @@
> #define WMAX_METHOD_AMPLIFIER_CABLE 0x6
> #define WMAX_METHOD_DEEP_SLEEP_CONTROL 0x0B
> #define WMAX_METHOD_DEEP_SLEEP_STATUS 0x0C
> +#define WMAX_METHOD_THERMAL_INFORMATION 0x14
> +#define WMAX_METHOD_THERMAL_CONTROL 0x15
> +
> +#define WMAX_ARG_GET_CURRENT_PROF 0x0B
> +
> +#define WMAX_FAILURE_CODE 0xFFFFFFFF
>
> MODULE_AUTHOR("Mario Limonciello <mario.limonciello@xxxxxxxxxxx>");
> MODULE_DESCRIPTION("Alienware special feature control");
> @@ -49,11 +58,27 @@ enum WMAX_CONTROL_STATES {
> WMAX_SUSPEND = 3,
> };
>
> +enum WMAX_THERMAL_PROFILE {
> + WMAX_THERMAL_QUIET = 0x96,
> + WMAX_THERMAL_BALANCED = 0x97,
> + WMAX_THERMAL_BALANCED_PERFORMANCE = 0x98,
> + WMAX_THERMAL_PERFORMANCE = 0x99,
> + WMAX_THERMAL_USTT_LOW_POWER = 0xA5,
> + WMAX_THERMAL_USTT_QUIET = 0xA3,
> + WMAX_THERMAL_USTT_BALANCED = 0xA0,
> + WMAX_THERMAL_USTT_BALANCED_PERFORMANCE = 0xA1,
> + WMAX_THERMAL_USTT_PERFORMANCE = 0xA4,
> + WMAX_THERMAL_GMODE = 0xAB,

While doing the next version, could also align these values please.

--
i.