[PATCH v3 0/6] platform-x86: lenovo-wmi: Add fixes and enhancement

Derek J. Clark posted 6 patches 1 month, 1 week ago
There is a newer version of this series
.../wmi/devices/lenovo-wmi-other.rst          |  21 +
drivers/platform/x86/lenovo/wmi-capdata.h     |  13 +-
drivers/platform/x86/lenovo/wmi-gamezone.h    |   1 +
drivers/platform/x86/lenovo/wmi-other.c       | 605 ++++++++++++++++--
4 files changed, 593 insertions(+), 47 deletions(-)
[PATCH v3 0/6] platform-x86: lenovo-wmi: Add fixes and enhancement
Posted by Derek J. Clark 1 month, 1 week ago
This series adds many much needed features and fixes to the lenovo-wmi
drivers.

Patch 1 adds a macro to make assigning attribute ID's for capdata
cleaner and easier.
Patch 2 addresses bugs where devices that don't support exposed
attributes would still create the attribute, and also attempts to
identify the correct capdata and set/get methods as some legacy
interfaces don't use the custom mode in the method or capdata ID.
Patch 3 adds the remaining CPU attributes that weren't previously
exposed.
Patch 4 adds the GPU attributes that weren't previously exposed.
Patch 5 consolidates name constants in preparation for patch 6.
Patch 6 adds battery charge-type limiting when supported only by WMI.

After applying Rong's series from
https://lore.kernel.org/platform-driver-x86/20260210191938.137234-1-i@rong.moe/
I found that there weren't any conflicts, so rather than combine
the series we can just review each separately.

Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
---
v3:
  - Re-add HWMON name const and jsut rename LWMI_OM_FW_ATTR_BASE_PATH
  - Fix linker warnings by moving acpi/battery include to the end of the
    list.
  - Remove CPU/GPU OC features. These attributes are BOOL type and will
    need a new constructor that I'll add later.
v2:
  - Fix gpu_mode misisng from attributes list.
  - Fix prototypes for power suppy patch.
  - Reorganize CPU and GPU attributes alphabetically.
  - Break out the patch consolidating the driver name cost.
  - Move some of the refactoring of attribute_id back to into patch 1
    where it belongs.
  - Fix some additional typos in function prototypes.
v1: https://lore.kernel.org/platform-driver-x86/20260213081243.794288-1-derekjohn.clark@gmail.com/

Derek J. Clark (6):
  platform/x86: lenovo-wmi-other: Add LWMI_ATTR_ID Macro
  platform/x86: lenovo-wmi-other: Limit adding attributes to supported
    devices
  platform/x86: lenovo-wmi-other: Add missing CPU tunable attributes
  platform/x86: lenovo-wmi-other: Add GPU tunable attributes
  platform-x86: lenovo-wmi-other: Rename LWMI_OM_FW_ATTR_BASE_PATH
  platform/x86: lenovo-wmi-other: Add WMI battery charge limiting.

 .../wmi/devices/lenovo-wmi-other.rst          |  21 +
 drivers/platform/x86/lenovo/wmi-capdata.h     |  13 +-
 drivers/platform/x86/lenovo/wmi-gamezone.h    |   1 +
 drivers/platform/x86/lenovo/wmi-other.c       | 605 ++++++++++++++++--
 4 files changed, 593 insertions(+), 47 deletions(-)

-- 
2.52.0
Re: [PATCH v3 0/6] platform-x86: lenovo-wmi: Add fixes and enhancement
Posted by Rong Zhang 1 month, 1 week ago
Hi Derek,

Sorry for the late reply. I was busier (yet happier ;-)) than I had
expected during the Spring Festival/Chinese New Year.

On Tue, 2026-02-24 at 04:31 +0000, Derek J. Clark wrote:
> This series adds many much needed features and fixes to the lenovo-wmi
> drivers.
> 
> Patch 1 adds a macro to make assigning attribute ID's for capdata
> cleaner and easier.
> Patch 2 addresses bugs where devices that don't support exposed
> attributes would still create the attribute, and also attempts to
> identify the correct capdata and set/get methods as some legacy
> interfaces don't use the custom mode in the method or capdata ID.
> Patch 3 adds the remaining CPU attributes that weren't previously
> exposed.
> Patch 4 adds the GPU attributes that weren't previously exposed.
> Patch 5 consolidates name constants in preparation for patch 6.
> Patch 6 adds battery charge-type limiting when supported only by WMI.
> 
> After applying Rong's series from
> https://lore.kernel.org/platform-driver-x86/20260210191938.137234-1-i@rong.moe/
> I found that there weren't any conflicts, so rather than combine
> the series we can just review each separately.
> 
> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>

The patch series makes sense to me in general except for some issues
mentioned in my previous replies.

With style issues fixed, you can add

Reviewed-By: Rong Zhang <i@rong.moe>

to patch 1,3,4,5.

Thanks,
Rong

> ---
> v3:
>   - Re-add HWMON name const and jsut rename LWMI_OM_FW_ATTR_BASE_PATH
>   - Fix linker warnings by moving acpi/battery include to the end of the
>     list.
>   - Remove CPU/GPU OC features. These attributes are BOOL type and will
>     need a new constructor that I'll add later.
> v2:
>   - Fix gpu_mode misisng from attributes list.
>   - Fix prototypes for power suppy patch.
>   - Reorganize CPU and GPU attributes alphabetically.
>   - Break out the patch consolidating the driver name cost.
>   - Move some of the refactoring of attribute_id back to into patch 1
>     where it belongs.
>   - Fix some additional typos in function prototypes.
> v1: https://lore.kernel.org/platform-driver-x86/20260213081243.794288-1-derekjohn.clark@gmail.com/
> 
> Derek J. Clark (6):
>   platform/x86: lenovo-wmi-other: Add LWMI_ATTR_ID Macro
>   platform/x86: lenovo-wmi-other: Limit adding attributes to supported
>     devices
>   platform/x86: lenovo-wmi-other: Add missing CPU tunable attributes
>   platform/x86: lenovo-wmi-other: Add GPU tunable attributes
>   platform-x86: lenovo-wmi-other: Rename LWMI_OM_FW_ATTR_BASE_PATH
>   platform/x86: lenovo-wmi-other: Add WMI battery charge limiting.
> 
>  .../wmi/devices/lenovo-wmi-other.rst          |  21 +
>  drivers/platform/x86/lenovo/wmi-capdata.h     |  13 +-
>  drivers/platform/x86/lenovo/wmi-gamezone.h    |   1 +
>  drivers/platform/x86/lenovo/wmi-other.c       | 605 ++++++++++++++++--
>  4 files changed, 593 insertions(+), 47 deletions(-)
Re: [PATCH v3 0/6] platform-x86: lenovo-wmi: Add fixes and enhancement
Posted by Derek J. Clark 1 month, 1 week ago
On February 25, 2026 10:02:21 AM PST, Rong Zhang <i@rong.moe> wrote:
>Hi Derek,
>
>Sorry for the late reply. I was busier (yet happier ;-)) than I had
>expected during the Spring Festival/Chinese New Year.

Not a problem, glad you enjoyed your time off.

>On Tue, 2026-02-24 at 04:31 +0000, Derek J. Clark wrote:
>> This series adds many much needed features and fixes to the lenovo-wmi
>> drivers.
>> 
>> Patch 1 adds a macro to make assigning attribute ID's for capdata
>> cleaner and easier.
>> Patch 2 addresses bugs where devices that don't support exposed
>> attributes would still create the attribute, and also attempts to
>> identify the correct capdata and set/get methods as some legacy
>> interfaces don't use the custom mode in the method or capdata ID.
>> Patch 3 adds the remaining CPU attributes that weren't previously
>> exposed.
>> Patch 4 adds the GPU attributes that weren't previously exposed.
>> Patch 5 consolidates name constants in preparation for patch 6.
>> Patch 6 adds battery charge-type limiting when supported only by WMI.
>> 
>> After applying Rong's series from
>> https://lore.kernel.org/platform-driver-x86/20260210191938.137234-1-i@rong.moe/
>> I found that there weren't any conflicts, so rather than combine
>> the series we can just review each separately.
>> 
>> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
>
>The patch series makes sense to me in general except for some issues
>mentioned in my previous replies.
>
>With style issues fixed, you can add
>
>Reviewed-By: Rong Zhang <i@rong.moe>
>
>to patch 1,3,4,5.
>
>Thanks,
>Rong

Thanks, will do after we agree on some of the details.

Cheers,
Derek
>> ---
>> v3:
>>   - Re-add HWMON name const and jsut rename LWMI_OM_FW_ATTR_BASE_PATH
>>   - Fix linker warnings by moving acpi/battery include to the end of the
>>     list.
>>   - Remove CPU/GPU OC features. These attributes are BOOL type and will
>>     need a new constructor that I'll add later.
>> v2:
>>   - Fix gpu_mode misisng from attributes list.
>>   - Fix prototypes for power suppy patch.
>>   - Reorganize CPU and GPU attributes alphabetically.
>>   - Break out the patch consolidating the driver name cost.
>>   - Move some of the refactoring of attribute_id back to into patch 1
>>     where it belongs.
>>   - Fix some additional typos in function prototypes.
>> v1: https://lore.kernel.org/platform-driver-x86/20260213081243.794288-1-derekjohn.clark@gmail.com/
>> 
>> Derek J. Clark (6):
>>   platform/x86: lenovo-wmi-other: Add LWMI_ATTR_ID Macro
>>   platform/x86: lenovo-wmi-other: Limit adding attributes to supported
>>     devices
>>   platform/x86: lenovo-wmi-other: Add missing CPU tunable attributes
>>   platform/x86: lenovo-wmi-other: Add GPU tunable attributes
>>   platform-x86: lenovo-wmi-other: Rename LWMI_OM_FW_ATTR_BASE_PATH
>>   platform/x86: lenovo-wmi-other: Add WMI battery charge limiting.
>> 
>>  .../wmi/devices/lenovo-wmi-other.rst          |  21 +
>>  drivers/platform/x86/lenovo/wmi-capdata.h     |  13 +-
>>  drivers/platform/x86/lenovo/wmi-gamezone.h    |   1 +
>>  drivers/platform/x86/lenovo/wmi-other.c       | 605 ++++++++++++++++--
>>  4 files changed, 593 insertions(+), 47 deletions(-)