From: "Kurt Borja" <kuurtb@gmail.com>
To: "Kurt Borja" <kuurtb@gmail.com>, <platform-driver-x86@vger.kernel.org>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Armin Wolf" <W_Armin@gmx.de>,
"Mario Limonciello" <mario.limonciello@amd.com>,
"Hans de Goede" <hdegoede@redhat.com>,
Dell.Client.Kernel@dell.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 07/14] platform/x86: alienware-wmi: Split DMI table
Date: Fri, 17 Jan 2025 12:15:19 -0500 [thread overview]
Message-ID: <D74INHNOTI0S.C7WFNTL0VLXA@gmail.com> (raw)
In-Reply-To: <20250117081347.8573-8-kuurtb@gmail.com>
On Fri Jan 17, 2025 at 3:13 AM -05, Kurt Borja wrote:
> Split thermal features into a new DMI table to support upcoming file
> split. While at it:
>
> Rename quirk_entry -> alienfx_features,
> Rename quirks -> alienfx
>
> and change hdmi_mux, amplifier and deepslp types to bool, because they are
> already being implicitly used as bools.
>
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> drivers/platform/x86/dell/alienware-wmi.c | 337 ++++++++++------------
> 1 file changed, 158 insertions(+), 179 deletions(-)
>
> diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c
> index 877b3d9d7cab..5d9816521072 100644
> --- a/drivers/platform/x86/dell/alienware-wmi.c
> +++ b/drivers/platform/x86/dell/alienware-wmi.c
> @@ -113,102 +113,68 @@ static const enum platform_profile_option wmax_mode_to_platform_profile[THERMAL_
> [THERMAL_MODE_BASIC_PERFORMANCE] = PLATFORM_PROFILE_PERFORMANCE,
> };
>
> -struct quirk_entry {
> +struct alienfx_quirks {
> u8 num_zones;
> - u8 hdmi_mux;
> - u8 amplifier;
> - u8 deepslp;
> - bool thermal;
> - bool gmode;
> + bool hdmi_mux;
> + bool amplifier;
> + bool deepslp;
> };
>
> -static struct quirk_entry *quirks;
> +static struct alienfx_quirks *alienfx;
>
>
> -static struct quirk_entry quirk_inspiron5675 = {
> +static struct alienfx_quirks quirk_inspiron5675 = {
> .num_zones = 2,
> - .hdmi_mux = 0,
> - .amplifier = 0,
> - .deepslp = 0,
> - .thermal = false,
> - .gmode = false,
> + .hdmi_mux = false,
> + .amplifier = false,
> + .deepslp = false,
> };
>
> -static struct quirk_entry quirk_unknown = {
> +static struct alienfx_quirks quirk_unknown = {
> .num_zones = 2,
> - .hdmi_mux = 0,
> - .amplifier = 0,
> - .deepslp = 0,
> - .thermal = false,
> - .gmode = false,
> + .hdmi_mux = false,
> + .amplifier = false,
> + .deepslp = false,
> };
>
> -static struct quirk_entry quirk_x51_r1_r2 = {
> +static struct alienfx_quirks quirk_x51_r1_r2 = {
> .num_zones = 3,
> - .hdmi_mux = 0,
> - .amplifier = 0,
> - .deepslp = 0,
> - .thermal = false,
> - .gmode = false,
> + .hdmi_mux = false,
> + .amplifier = false,
> + .deepslp = false,
> };
>
> -static struct quirk_entry quirk_x51_r3 = {
> +static struct alienfx_quirks quirk_x51_r3 = {
> .num_zones = 4,
> - .hdmi_mux = 0,
> - .amplifier = 1,
> - .deepslp = 0,
> - .thermal = false,
> - .gmode = false,
> + .hdmi_mux = false,
> + .amplifier = true,
> + .deepslp = false,
> };
>
> -static struct quirk_entry quirk_asm100 = {
> +static struct alienfx_quirks quirk_asm100 = {
> .num_zones = 2,
> - .hdmi_mux = 1,
> - .amplifier = 0,
> - .deepslp = 0,
> - .thermal = false,
> - .gmode = false,
> + .hdmi_mux = true,
> + .amplifier = false,
> + .deepslp = false,
> };
>
> -static struct quirk_entry quirk_asm200 = {
> +static struct alienfx_quirks quirk_asm200 = {
> .num_zones = 2,
> - .hdmi_mux = 1,
> - .amplifier = 0,
> - .deepslp = 1,
> - .thermal = false,
> - .gmode = false,
> + .hdmi_mux = true,
> + .amplifier = false,
> + .deepslp = true,
> };
>
> -static struct quirk_entry quirk_asm201 = {
> +static struct alienfx_quirks quirk_asm201 = {
> .num_zones = 2,
> - .hdmi_mux = 1,
> - .amplifier = 1,
> - .deepslp = 1,
> - .thermal = false,
> - .gmode = false,
> -};
> -
> -static struct quirk_entry quirk_g_series = {
> - .num_zones = 2,
> - .hdmi_mux = 0,
> - .amplifier = 0,
> - .deepslp = 0,
> - .thermal = true,
> - .gmode = true,
> -};
> -
> -static struct quirk_entry quirk_x_series = {
> - .num_zones = 2,
> - .hdmi_mux = 0,
> - .amplifier = 0,
> - .deepslp = 0,
> - .thermal = true,
> - .gmode = false,
> + .hdmi_mux = true,
> + .amplifier = true,
> + .deepslp = true,
> };
>
> static int __init dmi_matched(const struct dmi_system_id *dmi)
> {
> - quirks = dmi->driver_data;
> + alienfx = dmi->driver_data;
> return 1;
> }
>
> @@ -240,42 +206,6 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
> },
> .driver_data = &quirk_asm201,
> },
> - {
> - .callback = dmi_matched,
> - .ident = "Alienware m17 R5",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"),
> - },
> - .driver_data = &quirk_x_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Alienware m18 R2",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R2"),
> - },
> - .driver_data = &quirk_x_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Alienware x15 R1",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R1"),
> - },
> - .driver_data = &quirk_x_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Alienware x17 R2",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x17 R2"),
> - },
> - .driver_data = &quirk_x_series,
> - },
> {
> .callback = dmi_matched,
> .ident = "Alienware X51 R1",
> @@ -303,60 +233,6 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
> },
> .driver_data = &quirk_x51_r3,
> },
> - {
> - .callback = dmi_matched,
> - .ident = "Dell Inc. G15 5510",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5510"),
> - },
> - .driver_data = &quirk_g_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Dell Inc. G15 5511",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5511"),
> - },
> - .driver_data = &quirk_g_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Dell Inc. G15 5515",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
> - },
> - .driver_data = &quirk_g_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Dell Inc. G3 3500",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> - DMI_MATCH(DMI_PRODUCT_NAME, "G3 3500"),
> - },
> - .driver_data = &quirk_g_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Dell Inc. G3 3590",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> - DMI_MATCH(DMI_PRODUCT_NAME, "G3 3590"),
> - },
> - .driver_data = &quirk_g_series,
> - },
> - {
> - .callback = dmi_matched,
> - .ident = "Dell Inc. G5 5500",
> - .matches = {
> - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> - DMI_MATCH(DMI_PRODUCT_NAME, "G5 5500"),
> - },
> - .driver_data = &quirk_g_series,
> - },
> {
> .callback = dmi_matched,
> .ident = "Dell Inc. Inspiron 5675",
> @@ -431,6 +307,103 @@ struct alienfx_platdata {
>
> static u8 interface;
>
> +struct awcc_quirks {
> + bool gmode;
> +};
> +
> +static struct awcc_quirks g_series_quirks = {
> + .gmode = true,
> +};
> +
> +static struct awcc_quirks generic_quirks = {
> + .gmode = false,
> +};
> +
> +static const struct dmi_system_id awcc_dmi_table[] __initconst = {
> + {
> + .ident = "Alienware m17 R5",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"),
> + },
> + .driver_data = &generic_quirks,
> + },
> + {
> + .ident = "Alienware m18 R2",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R2"),
> + },
> + .driver_data = &generic_quirks,
> + },
> + {
> + .ident = "Alienware x15 R1",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R1"),
> + },
> + .driver_data = &generic_quirks,
> + },
> + {
> + .ident = "Alienware x17 R2",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x17 R2"),
> + },
> + .driver_data = &generic_quirks,
> + },
> + {
> + .ident = "Dell Inc. G15 5510",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5510"),
> + },
> + .driver_data = &g_series_quirks,
> + },
> + {
> + .ident = "Dell Inc. G15 5511",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5511"),
> + },
> + .driver_data = &g_series_quirks,
> + },
> + {
> + .ident = "Dell Inc. G15 5515",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
> + },
> + .driver_data = &g_series_quirks,
> + },
> + {
> + .ident = "Dell Inc. G3 3500",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "G3 3500"),
> + },
> + .driver_data = &g_series_quirks,
> + },
> + {
> + .ident = "Dell Inc. G3 3590",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "G3 3590"),
> + },
> + .driver_data = &g_series_quirks,
> + },
> + {
> + .ident = "Dell Inc. G5 5500",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "G5 5500"),
> + },
> + .driver_data = &g_series_quirks,
> + },
> +};
> +
> +struct awcc_quirks *awcc;
I just noticed this should be static. I'll fix for v5 after Armin's
feedback.
~ Kurt
> <snip>
next prev parent reply other threads:[~2025-01-17 17:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 8:13 [PATCH v4 00/14] platform/x86: alienware-wmi driver rework Kurt Borja
2025-01-17 8:13 ` [PATCH v4 01/14] platform/x86: alienware-wmi: Add a state container for LED control feature Kurt Borja
2025-01-18 23:34 ` Armin Wolf
2025-01-17 8:13 ` [PATCH v4 02/14] platform/x86: alienware-wmi: Add WMI Drivers Kurt Borja
2025-01-18 23:48 ` Armin Wolf
2025-01-19 16:47 ` Kurt Borja
2025-01-17 8:13 ` [PATCH v4 03/14] platform/x86: alienware-wmi: Add a state container for thermal control methods Kurt Borja
2025-01-17 8:13 ` [PATCH v4 04/14] platform/x86: alienware-wmi: Refactor LED " Kurt Borja
2025-01-18 23:58 ` Armin Wolf
2025-01-19 16:50 ` Kurt Borja
2025-01-17 8:13 ` [PATCH v4 05/14] platform/x86: alienware-wmi: Refactor hdmi, amplifier, deepslp methods Kurt Borja
2025-01-17 8:13 ` [PATCH v4 06/14] platform/x86: alienware-wmi: Refactor thermal control methods Kurt Borja
2025-01-17 8:13 ` [PATCH v4 07/14] platform/x86: alienware-wmi: Split DMI table Kurt Borja
2025-01-17 17:15 ` Kurt Borja [this message]
2025-01-19 0:03 ` Armin Wolf
2025-01-17 8:13 ` [PATCH v4 08/14] MAINTAINERS: Update ALIENWARE WMI DRIVER entry Kurt Borja
2025-01-17 8:13 ` [PATCH v4 09/14] platform/x86: Rename alienware-wmi.c Kurt Borja
2025-01-17 8:13 ` [PATCH v4 10/14] platform/x86: Add alienware-wmi.h Kurt Borja
2025-01-17 8:13 ` [PATCH v4 11/14] platform/x86: Split the alienware-wmi driver Kurt Borja
2025-01-17 8:13 ` [PATCH v4 12/14] platform/x86: dell: Modify Makefile alignment Kurt Borja
2025-01-17 8:13 ` [PATCH v4 13/14] platform/x86: Update alienware-wmi config entries Kurt Borja
2025-01-17 8:13 ` [PATCH v4 14/14] platform/x86: alienware-wmi: Update header and module information Kurt Borja
2025-01-19 0:09 ` [PATCH v4 00/14] platform/x86: alienware-wmi driver rework Armin Wolf
2025-01-19 16:53 ` Kurt Borja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D74INHNOTI0S.C7WFNTL0VLXA@gmail.com \
--to=kuurtb@gmail.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=W_Armin@gmx.de \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome