[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba1ed892-01e3-20fd-85ce-fae9ad10e96f@linux.intel.com>
Date: Thu, 5 Dec 2024 13:14:43 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Kurt Borja <kuurtb@...il.com>
cc: Dell.Client.Kernel@...l.com, Hans de Goede <hdegoede@...hat.com>,
LKML <linux-kernel@...r.kernel.org>, mario.limonciello@....com,
platform-driver-x86@...r.kernel.org, w_armin@....de
Subject: Re: [RFC PATCH 17/21] alienware-wmi: Drop thermal methods dependency
on quirks
On Wed, 4 Dec 2024, Kurt Borja wrote:
> Make the `gmode` condition on AWCC WMI devices part of the device's
> state container, and refactor "platform_profile" methods accordingly.
>
> Signed-off-by: Kurt Borja <kuurtb@...il.com>
> ---
> drivers/platform/x86/dell/alienware-wmi.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c
> index fa21a50d66bd..7137995d5983 100644
> --- a/drivers/platform/x86/dell/alienware-wmi.c
> +++ b/drivers/platform/x86/dell/alienware-wmi.c
> @@ -407,6 +407,7 @@ struct awcc_priv {
> struct wmi_device *wdev;
> struct platform_profile_handler pp_handler;
> enum wmax_thermal_mode supported_thermal_profiles[PLATFORM_PROFILE_LAST];
> + bool has_gmode;
> };
>
> struct alienfx_priv {
> @@ -1044,7 +1045,7 @@ static int thermal_profile_set(struct platform_profile_handler *pprof,
>
> priv = container_of(pprof, struct awcc_priv, pp_handler);
>
> - if (quirks->gmode) {
> + if (priv->has_gmode) {
> u32 gmode_status;
> int ret;
>
> @@ -1070,7 +1071,7 @@ static int thermal_profile_set(struct platform_profile_handler *pprof,
> priv->supported_thermal_profiles[profile]);
> }
>
> -static int create_thermal_profile(struct wmi_device *wdev)
> +static int create_thermal_profile(struct wmi_device *wdev, bool has_gmode)
> {
> struct awcc_priv *priv;
> u32 out_data;
> @@ -1115,7 +1116,8 @@ static int create_thermal_profile(struct wmi_device *wdev)
> if (bitmap_empty(priv->pp_handler.choices, PLATFORM_PROFILE_LAST))
> return -ENODEV;
>
> - if (quirks->gmode) {
> + if (has_gmode) {
> + priv->has_gmode = true;
> priv->supported_thermal_profiles[PLATFORM_PROFILE_PERFORMANCE] =
> WMAX_THERMAL_MODE_GMODE;
>
> @@ -1130,8 +1132,7 @@ static int create_thermal_profile(struct wmi_device *wdev)
>
> static void remove_thermal_profile(void)
> {
> - if (quirks->thermal)
> - platform_profile_remove();
> + platform_profile_remove();
Did you intend to make this change in this patch?
I'm unable to confirm why the if () could now be removed and how it is
related to other parts of this patch.
> }
>
> /*
> @@ -1339,7 +1340,7 @@ static int wmax_wmi_probe(struct wmi_device *wdev, const void *context)
> };
>
> if (quirks->thermal)
> - ret = create_thermal_profile(wdev);
> + ret = create_thermal_profile(wdev, quirks->gmode);
> else if (quirks->num_zones > 0)
> ret = alienfx_wmi_init(&pdata);
>
>
--
i.
Powered by blists - more mailing lists