Skip to content

Commit c7225c7

Browse files
authored
Merge pull request #8 from OpenGamingCollective/6.19/pastaq/lenovo-wmi-other
platform-x86: lenovo-wmi: Add fixes and enhancement
2 parents 3b885f6 + 6e88798 commit c7225c7

File tree

10 files changed

+2049
-398
lines changed

10 files changed

+2049
-398
lines changed

Documentation/wmi/devices/lenovo-wmi-other.rst

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,32 @@ under the following path:
3131

3232
/sys/class/firmware-attributes/lenovo-wmi-other/attributes/<attribute>/
3333

34+
Additionally, this driver also exports attributes to HWMON.
35+
36+
LENOVO_CAPABILITY_DATA_00
37+
-------------------------
38+
39+
WMI GUID ``362A3AFE-3D96-4665-8530-96DAD5BB300E``
40+
41+
The LENOVO_CAPABILITY_DATA_00 interface provides various information that
42+
does not rely on the gamezone thermal mode.
43+
44+
The following HWMON attributes are implemented:
45+
- fanX_div: internal RPM divisor
46+
- fanX_input: current RPM
47+
- fanX_target: target RPM (tunable, 0=auto)
48+
49+
Due to the internal RPM divisor, the current/target RPMs are rounded down to
50+
its nearest multiple. The divisor itself is not necessary to be a power of two.
51+
3452
LENOVO_CAPABILITY_DATA_01
3553
-------------------------
3654

3755
WMI GUID ``7A8F5407-CB67-4D6E-B547-39B3BE018154``
3856

39-
The LENOVO_CAPABILITY_DATA_01 interface provides information on various
40-
power limits of integrated CPU and GPU components.
57+
The LENOVO_CAPABILITY_DATA_01 interface provides various information that
58+
relies on the gamezone thermal mode, including power limits of integrated
59+
CPU and GPU components.
4160

4261
Each attribute has the following properties:
4362
- current_value
@@ -48,11 +67,43 @@ Each attribute has the following properties:
4867
- scalar_increment
4968
- type
5069

51-
The following attributes are implemented:
70+
The following firmware-attributes are implemented:
71+
- cpu_oc_stat: CPU Overlocking Status
72+
- cpu_temp: CPU Thermal Load Limit
73+
- dgpu_boost_clk: Dedicated GPU Boost Clock
74+
- dgpu_enable: Dedicated GPU Enabled Status
75+
- gpu_didvid: GPU Device Identifier and Vendor Identifier
76+
- gpu_mode: GPU Mode by Power Limit
77+
- gpu_nv_ac_offset: Nvidia GPU AC Total Processing Power Baseline Offset
78+
- gpu_nv_bpl: Nvidia GPU Base Power Limit
79+
- gpu_nv_cpu_boost: Nvidia GPU to CPU Dynamic Boost Limit
80+
- gpu_nv_ctgp: Nvidia GPU Configurable Total Graphics Power
81+
- gpu_nv_ppab: Nvidia GPU Power Performance Aware Boost Limit
82+
- gpu_oc_stat: GPU Overclocking Status
83+
- gpu_temp: GPU Thermal Load Limit
84+
- ppt_cpu_cl: CPU Cross Loading Power Limit
85+
- ppt_pl1_apu_spl: Platform Profile Tracking APU Sustained Power Limit
5286
- ppt_pl1_spl: Platform Profile Tracking Sustained Power Limit
87+
- ppt_pl1_spl_cl: Platform Profile Tracking Cross Loading Sustained Power Limit
88+
- ppt_pl1_tau: Exceed Duration for Platform Profile Tracking Sustained Power Limit
5389
- ppt_pl2_sppt: Platform Profile Tracking Slow Package Power Tracking
90+
- ppt_pl2_sppt_cl: Platform Profile Tracking Cross Loading Slow Package Tracking
5491
- ppt_pl3_fppt: Platform Profile Tracking Fast Package Power Tracking
92+
- ppt_pl3_fppt_cl: Platform Profile Tracking Cross Loading Fast Package Power Tracking
93+
- ppt_pl4_ipl: Platform Profile Trakcing Instantaneous Power Limit
94+
- ppt_pl4_ipl_cl: Platform Profile Tracking Cross Loading Instantaneous Power Limit
5595

96+
LENOVO_FAN_TEST_DATA
97+
-------------------------
98+
99+
WMI GUID ``B642801B-3D21-45DE-90AE-6E86F164FB21``
100+
101+
The LENOVO_FAN_TEST_DATA interface provides reference data for self-test of
102+
cooling fans.
103+
104+
The following HWMON attributes are implemented:
105+
- fanX_max: maximum RPM
106+
- fanX_min: minimum RPM
56107

57108
WMI interface description
58109
=========================
@@ -106,3 +157,13 @@ data using the `bmfdec <https://github.com/pali/bmfdec>`_ utility:
106157
[WmiDataId(3), read, Description("Data Size.")] uint32 DataSize;
107158
[WmiDataId(4), read, Description("Default Value"), WmiSizeIs("DataSize")] uint8 DefaultValue[];
108159
};
160+
161+
[WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("Definition of Fan Test Data"), guid("{B642801B-3D21-45DE-90AE-6E86F164FB21}")]
162+
class LENOVO_FAN_TEST_DATA {
163+
[key, read] string InstanceName;
164+
[read] boolean Active;
165+
[WmiDataId(1), read, Description("Mode.")] uint32 NumOfFans;
166+
[WmiDataId(2), read, Description("Fan ID."), WmiSizeIs("NumOfFans")] uint32 FanId[];
167+
[WmiDataId(3), read, Description("Maximum Fan Speed."), WmiSizeIs("NumOfFans")] uint32 FanMaxSpeed[];
168+
[WmiDataId(4), read, Description("Minumum Fan Speed."), WmiSizeIs("NumOfFans")] uint32 FanMinSpeed[];
169+
};

drivers/platform/x86/lenovo/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ config YT2_1380
233233
To compile this driver as a module, choose M here: the module will
234234
be called lenovo-yogabook.
235235

236-
config LENOVO_WMI_DATA01
236+
config LENOVO_WMI_CAPDATA
237237
tristate
238238
depends on ACPI_WMI
239239

@@ -263,8 +263,9 @@ config LENOVO_WMI_GAMEZONE
263263
config LENOVO_WMI_TUNING
264264
tristate "Lenovo Other Mode WMI Driver"
265265
depends on ACPI_WMI
266+
select HWMON
266267
select FW_ATTR_CLASS
267-
select LENOVO_WMI_DATA01
268+
select LENOVO_WMI_CAPDATA
268269
select LENOVO_WMI_EVENTS
269270
select LENOVO_WMI_HELPERS
270271
help

drivers/platform/x86/lenovo/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ lenovo-target-$(CONFIG_LENOVO_YMC) += ymc.o
1212
lenovo-target-$(CONFIG_YOGABOOK) += yogabook.o
1313
lenovo-target-$(CONFIG_YT2_1380) += yoga-tab2-pro-1380-fastcharger.o
1414
lenovo-target-$(CONFIG_LENOVO_WMI_CAMERA) += wmi-camera.o
15-
lenovo-target-$(CONFIG_LENOVO_WMI_DATA01) += wmi-capdata01.o
15+
lenovo-target-$(CONFIG_LENOVO_WMI_CAPDATA) += wmi-capdata.o
1616
lenovo-target-$(CONFIG_LENOVO_WMI_EVENTS) += wmi-events.o
1717
lenovo-target-$(CONFIG_LENOVO_WMI_HELPERS) += wmi-helpers.o
1818
lenovo-target-$(CONFIG_LENOVO_WMI_GAMEZONE) += wmi-gamezone.o

0 commit comments

Comments
 (0)