Re: [PATCH v4 6/6 RESEND] platform/x86: Add Lenovo Gamezone WMI Driver
From: Ilpo Järvinen
Date: Thu Apr 03 2025 - 06:54:54 EST
On Wed, 2 Apr 2025, Derek John Clark wrote:
> On Thu, Mar 27, 2025 at 6:56 AM Ilpo Järvinen
> <ilpo.jarvinen@xxxxxxxxxxxxxxx> wrote:
> >
> > On Mon, 17 Mar 2025, Derek J. Clark wrote:
> >
> > > Adds lenovo-wmi-gamezone driver which provides the Lenovo Gamezone WMI
> > > interface that comes on Lenovo "Gaming Series" hardware. Provides ACPI
> > > platform profiles over WMI.
> > >
> > > Signed-off-by: Derek J. Clark <derekjohn.clark@xxxxxxxxx>
> >
> > This has a few similar nits I flagged for the other patches but I won't
> > mark them here again but please go through the patches to find similar
> > cases.
> >
> > > ---
> > > v4:
> > > - Add notifier blocks for the Events and Other Mode drivers.
> > > - Remove notifier block chain head and all reference to Thermal Mode
> > > Event GUID.
> > > - Add header for Gamezone specific structs and functions.
> > > - Various fixes from review.
> > > v3:
> > > - Use notifier chain to report platform profile changes to any
> > > subscribed drivers.
> > > - Adds THERMAL_MODE_EVENT GUID and .notify function to trigger notifier
> > > chain.
> > > - Adds support for Extreme Mode profile on supported hardware, as well
> > > as a DMI quirk table for some devices that report extreme mode version
> > > support but so not have it fully implemented.
> > > - Update to include recent changes to platform-profile.
> > > v2:
> > > - Use devm_kmalloc to ensure driver can be instanced, remove global
> > > reference.
> > > - Ensure reverse Christmas tree for all variable declarations.
> > > - Remove extra whitespace.
> > > - Use guard(mutex) in all mutex instances, global mutex.
> > > - Use pr_fmt instead of adding the driver name to each pr_err.
> > > - Remove noisy pr_info usage.
> > > - Rename gamezone_wmi to lenovo_wmi_gz_priv and gz_wmi to priv.
> > > - Remove GZ_WMI symbol exporting.
> > > ---
> > > MAINTAINERS | 2 +
> > > drivers/platform/x86/Kconfig | 13 +
> > > drivers/platform/x86/Makefile | 1 +
> > > drivers/platform/x86/lenovo-wmi-gamezone.c | 380 +++++++++++++++++++++
> > > drivers/platform/x86/lenovo-wmi-gamezone.h | 18 +
> > > 5 files changed, 414 insertions(+)
> > > create mode 100644 drivers/platform/x86/lenovo-wmi-gamezone.c
> > > create mode 100644 drivers/platform/x86/lenovo-wmi-gamezone.h
> > >
> > > diff --git a/drivers/platform/x86/lenovo-wmi-gamezone.h b/drivers/platform/x86/lenovo-wmi-gamezone.h
> > > new file mode 100644
> > > index 000000000000..ac536803160b
> > > --- /dev/null
> > > +++ b/drivers/platform/x86/lenovo-wmi-gamezone.h
> > > @@ -0,0 +1,18 @@
> > > +/* SPDX-License-Identifier: GPL-2.0-or-later
> > > + *
> > > + * Copyright(C) 2025 Derek J. Clark <derekjohn.clark@xxxxxxxxx>
> > > + *
> > > + */
> > > +
> > > +#ifndef _LENOVO_WMI_GAMEZONE_H_
> > > +#define _LENOVO_WMI_GAMEZONE_H_
> > > +
> > > +enum thermal_mode {
> > > + SMARTFAN_MODE_QUIET = 0x01,
> > > + SMARTFAN_MODE_BALANCED = 0x02,
> > > + SMARTFAN_MODE_PERFORMANCE = 0x03,
> > > + SMARTFAN_MODE_EXTREME = 0xE0, /* Ver 6+ */
> > > + SMARTFAN_MODE_CUSTOM = 0xFF,
> > > +};
> > > +
> > > +#endif /* !_LENOVO_WMI_GAMEZONE_H_ */
> > >
> >
> > Are these going the be used by other .c files?
> >
>
> They are used across different c files in this series. The
> lenovo-wmi-other driver uses every header.
Oh, how can this then be the last patch of the series???
Won't the build fail before this patch for lenovo-wmi-other.c?
--
i.