Skip to content

Commit da6b5aa

Browse files
committed
Merge tag 'platform-drivers-x86-v7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver updates from Ilpo Järvinen: "asus-wmi: - Retain battery charge threshold during boot which avoids unsolicited change to 100%. Return -ENODATA when the limit is not yet known - Improve screenpad power/brightness handling consistency - Fix screenpad brightness range barco-p50-gpio: - Normalize gpio_get return values bitland-mifs-wmi: - Add driver for Bitland laptops (supports platform profile, hwmon, kbd backlight, gpu mode, hotkeys, and fan boost) dell_rbu: - Fix using uninitialized value in sysfs write function dell-wmi-sysman: - Respect destination length when constructing enum strings hp-wmi: - Propagate fan setting apply failures and log an error - Fix sysfs write vs work handler cancel_delayed_work_sync() deadlock - Correct keepalive schedule_delayed_work() to mod_delayed_work() - Fix u8 underflows in GPU delta calculation - Use mutex to protect fan pwm/mode - Ignore kbd backlight and FnLock key events that are handled by FW - Fix fan table parsing (use correct field) - Add support for Omen 14-fb0xxx, 16-n0xxx, 16-wf1xxx, and Omen MAX 16-ak0xxxx input: trackpoint & thinkpad_acpi: - Enable doubletap by default and add sysfs enable/disable int3472: - Add support for GPIO type 0x02 (IR flood LED) intel-speed-select: (updated to v1.26) - Avoid using current base frequency as maximum - Fix CPU extended family ID decoding - Fix exit code - Improve error reporting intel/vsec: - Refactor to support ACPI-enumerated PMT endpoints. pcengines-apuv2: - Attach software node to the gpiochip uniwill: - Refactor hwmon to smaller parts to accomodate HW diversity - Support USB-C power/performance priority switch through sysfs - Add another XMG Fusion 15 (L19) DMI vendor - Enable fine-grained features to device lineup mapping wmi: - Perform output size check within WMI core to allow simpler WMI drivers misc: - acpi_driver -> platform driver conversions (a large number of changes from Rafael J. Wysocki) - cleanups / refactoring / improvements" * tag 'platform-drivers-x86-v7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (106 commits) platform/x86: hp-wmi: Add support for Omen 16-wf1xxx (8C77) platform/x86: hp-wmi: Add support for Omen 16-n0xxx (8A44) platform/x86: hp-wmi: Add support for OMEN MAX 16-ak0xxx (8D87) platform/x86: hp-wmi: fix fan table parsing platform/x86: hp-wmi: add Omen 14-fb0xxx (board 8C58) support platform/wmi: Replace .no_notify_data with .min_event_size platform/wmi: Extend wmidev_query_block() to reject undersized data platform/wmi: Extend wmidev_invoke_method() to reject undersized data platform/wmi: Prepare to reject undersized unmarshalling results platform/wmi: Convert drivers to use wmidev_invoke_procedure() platform/wmi: Add wmidev_invoke_procedure() platform/x86: int3472: Add support for GPIO type 0x02 (IR flood LED) platform/x86: int3472: Parameterize LED con_id in registration platform/x86: int3472: Rename pled to led in LED registration code platform/x86: int3472: Use local variable for LED struct access platform/x86: thinkpad_acpi: remove obsolete TODO comment platform/x86: dell-wmi-sysman: bound enumeration string aggregation platform/x86: hp-wmi: Ignore backlight and FnLock events platform/x86: uniwill-laptop: Fix signedness bug platform/x86: dell_rbu: avoid uninit value usage in packet_size_write() ...
2 parents b69e478 + 344bf52 commit da6b5aa

78 files changed

Lines changed: 3073 additions & 1309 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/ABI/testing/sysfs-driver-uniwill-laptop

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,30 @@ Description:
5151

5252
Reading this file returns the current status of the breathing animation
5353
functionality.
54+
55+
What: /sys/bus/platform/devices/INOU0000:XX/ctgp_offset
56+
Date: January 2026
57+
KernelVersion: 7.0
58+
Contact: Werner Sembach <[email protected]>
59+
Description:
60+
Allows userspace applications to set the configurable TGP offset on top of the base
61+
TGP. Base TGP and max TGP and therefore the max cTGP offset are device specific.
62+
Note that setting the maximum cTGP leaves no window open for Dynamic Boost as
63+
Dynamic Boost also can not go over max TGP. Setting the cTGP to maximum is
64+
effectively disabling Dynamic Boost and telling the device to always prioritize the
65+
GPU over the CPU.
66+
67+
Reading this file returns the current configurable TGP offset.
68+
69+
What: /sys/bus/platform/devices/INOU0000:XX/usb_c_power_priority
70+
Date: February 2026
71+
KernelVersion: 7.1
72+
Contact: Werner Sembach <[email protected]>
73+
Description:
74+
Allows userspace applications to choose the USB-C power distribution profile between
75+
one that offers a bigger share of the power to the battery and one that offers more
76+
of it to the CPU. Writing "charging"/"performance" into this file selects the
77+
respective profile.
78+
79+
Reading this file returns the profile names with the currently active one in
80+
brackets.

Documentation/admin-guide/laptops/thinkpad-acpi.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,27 @@ Currently 2 antenna types are supported as mentioned below:
15221522
The property is read-only. If the platform doesn't have support the sysfs
15231523
class is not created.
15241524

1525+
doubletap_enable
1526+
----------------
1527+
1528+
sysfs: doubletap_enable
1529+
1530+
Controls whether TrackPoint doubletap events are filtered out. Doubletap is a
1531+
feature where quickly tapping the TrackPoint twice triggers a special function key event.
1532+
1533+
The available commands are::
1534+
1535+
cat /sys/devices/platform/thinkpad_acpi/doubletap_enable
1536+
echo 1 | sudo tee /sys/devices/platform/thinkpad_acpi/doubletap_enable
1537+
echo 0 | sudo tee /sys/devices/platform/thinkpad_acpi/doubletap_enable
1538+
1539+
Values:
1540+
1541+
* 1 - doubletap events are processed (default)
1542+
* 0 - doubletap events are filtered out (ignored)
1543+
1544+
This setting can also be toggled via the Fn+doubletap hotkey.
1545+
15251546
Auxmac
15261547
------
15271548

Documentation/admin-guide/laptops/uniwill-laptop.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ between 1 and 100 percent are supported.
5050
Additionally the driver signals the presence of battery charging issues through the standard
5151
``health`` power supply sysfs attribute.
5252

53+
It also lets you set whether a USB-C power source should prioritise charging the battery or
54+
delivering immediate power to the cpu. See Documentation/ABI/testing/sysfs-driver-uniwill-laptop for
55+
details.
56+
5357
Lightbar
5458
--------
5559

@@ -58,3 +62,11 @@ LED class device. The default name of this LED class device is ``uniwill:multico
5862

5963
See Documentation/ABI/testing/sysfs-driver-uniwill-laptop for details on how to control the various
6064
animation modes of the lightbar.
65+
66+
Configurable TGP
67+
----------------
68+
69+
The ``uniwill-laptop`` driver allows to set the configurable TGP for devices with NVIDIA GPUs that
70+
allow it.
71+
72+
See Documentation/ABI/testing/sysfs-driver-uniwill-laptop for details.
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
.. SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
========================================
4+
Bitland MIFS driver (bitland-mifs-wmi)
5+
========================================
6+
7+
Introduction
8+
============
9+
10+
11+
EC WMI interface description
12+
============================
13+
14+
The EC WMI interface description can be decoded from the embedded binary MOF (bmof)
15+
data using the `bmfdec <https://github.com/pali/bmfdec>`_ utility:
16+
17+
::
18+
19+
class WMIEvent : __ExtrinsicEvent {
20+
};
21+
22+
[WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x40A"), Description("Root WMI HID_EVENT20"), guid("{46c93e13-ee9b-4262-8488-563bca757fef}")]
23+
class HID_EVENT20 : WmiEvent {
24+
[key, read] string InstanceName;
25+
[read] boolean Active;
26+
[WmiDataId(1), read, write, Description("Package Data")] uint8 EventDetail[8];
27+
};
28+
29+
[WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x40A"), Description("Root WMI HID_EVENT21"), guid("{fa78e245-2c0f-4ca1-91cf-15f34e474850}")]
30+
class HID_EVENT21 : WmiEvent {
31+
[key, read] string InstanceName;
32+
[read] boolean Active;
33+
[WmiDataId(1), read, write, Description("Package Data")] uint8 EventDetail[8];
34+
};
35+
36+
[WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x40A"), Description("Root WMI HID_EVENT22"), guid("{1dceaf0a-4d63-44bb-bd0c-0d6281bfddc5}")]
37+
class HID_EVENT22 : WmiEvent {
38+
[key, read] string InstanceName;
39+
[read] boolean Active;
40+
[WmiDataId(1), read, write, Description("Package Data")] uint8 EventDetail[8];
41+
};
42+
43+
[WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x40A"), Description("Root WMI HID_EVENT23"), guid("{3f9e3c26-b077-4f86-91f5-37ff64d8c7ed}")]
44+
class HID_EVENT23 : WmiEvent {
45+
[key, read] string InstanceName;
46+
[read] boolean Active;
47+
[WmiDataId(1), read, write, Description("Package Data")] uint8 EventDetail[8];
48+
};
49+
50+
[WMI, Dynamic, provider("WmiProv"), Locale("MS\\0x409"), Description("Class used to operate firmware interface"), guid("{b60bfb48-3e5b-49e4-a0e9-8cffe1b3434b}")]
51+
class MICommonInterface {
52+
[key, read] string InstanceName;
53+
[read] boolean Active;
54+
55+
[WmiMethodId(1), Implemented, read, write, Description("Method used to support system functions.")] void MiInterface([in, Description("WMI Interface")] uint8 InData[32], [out] uint8 OutData[30], [out] uint16 Reserved);
56+
};
57+
58+
Reverse-Engineering the EC WMI interface
59+
========================================
60+
61+
The OEM software can be download from `this link <https://iknow.lenovo.com.cn/detail/429447>`_
62+
63+
Nothing is obfuscated, In this case, `ILSpy <https://github.com/icsharpcode/ILSpy>`_ could be helpful.
64+
65+
WMI Methods (MICommonInterface)
66+
========================================
67+
68+
The ``MICommonInterface`` class (GUID: ``{b60bfb48-3e5b-49e4-a0e9-8cffe1b3434b}``)
69+
is the primary control interface. It uses a 32-byte buffer for both input
70+
(``InData``) and output (``OutData``).
71+
72+
Method Structure
73+
----------------
74+
75+
The data packet follows a standardized format:
76+
77+
+----------+------------------------------------------------------------------+
78+
| Byte | Description |
79+
+==========+==================================================================+
80+
| 1 | Method Type: Get (0xFA / 250) or Set (0xFB / 251) |
81+
+----------+------------------------------------------------------------------+
82+
| 3 | Command ID (Method Name) |
83+
+----------+------------------------------------------------------------------+
84+
| 4 - 31 | Arguments (for Set) or Return Data (for Get) |
85+
+----------+------------------------------------------------------------------+
86+
87+
88+
Command IDs
89+
-----------
90+
91+
The following Command IDs are used in the third byte of the buffer:
92+
93+
+----------+-----------------------+------------------------------------------+
94+
| ID | Name | Values / Description |
95+
+==========+=======================+==========================================+
96+
| 8 | SystemPerMode | 0: Balance, 1: Performance, 2: Quiet, |
97+
| | | 3: Full-speed |
98+
+----------+-----------------------+------------------------------------------+
99+
| 9 | GPUMode | 0: Hybrid, 1: Discrete, 2: UMA |
100+
+----------+-----------------------+------------------------------------------+
101+
| 10 | KeyboardType | 0: White, 1: Single RGB, 2: Zone RGB |
102+
+----------+-----------------------+------------------------------------------+
103+
| 11 | FnLock | 0: Off, 1: On |
104+
+----------+-----------------------+------------------------------------------+
105+
| 12 | TPLock | 0: Unlock, 1: Lock (Touchpad) |
106+
+----------+-----------------------+------------------------------------------+
107+
| 13 | CPUGPUSYSFanSpeed | Returns 12 bytes of fan data: |
108+
| | | Bytes 4-5: CPU Fan RPM (Little Endian) |
109+
| | | Bytes 6-7: GPU Fan RPM (Little Endian) |
110+
| | | Bytes 10-11: SYS Fan RPM (Little Endian) |
111+
+----------+-----------------------+------------------------------------------+
112+
| 16 | RGBKeyboardMode | 0: Off, 1: Auto Cyclic, 2: Fixed, |
113+
| | | 3: Custom |
114+
+----------+-----------------------+------------------------------------------+
115+
| 17 | RGBKeyboardColor | Bytes 4, 5, 6: Red, Green, Blue values |
116+
+----------+-----------------------+------------------------------------------+
117+
| 18 | RGBKeyboardBrightness | 0-10: Brightness Levels, 128: Auto |
118+
+----------+-----------------------+------------------------------------------+
119+
| 19 | SystemAcType | 1: Type-C, 2: Circular Hole (DC) |
120+
+----------+-----------------------+------------------------------------------+
121+
| 20 | MaxFanSpeedSwitch | Byte 4: Fan Type (0: CPU/GPU, 1: SYS) |
122+
| | | Byte 5: State (0: Off, 1: On) |
123+
+----------+-----------------------+------------------------------------------+
124+
| 21 | MaxFanSpeed | Sets manual fan speed duty cycle |
125+
+----------+-----------------------+------------------------------------------+
126+
| 22 | CPUThermometer | Returns CPU Temperature |
127+
+----------+-----------------------+------------------------------------------+
128+
129+
WMI Events (HID_EVENT20)
130+
========================
131+
132+
The driver listens for events from the ``HID_EVENT20`` class
133+
(GUID: ``{46c93e13-ee9b-4262-8488-563bca757fef}``). These events are triggered
134+
by hotkeys or system state changes (e.g., plugging in AC power).
135+
136+
Event Structure
137+
---------------
138+
139+
The event data is provided in an 8-byte array (``EventDetail``):
140+
141+
+----------+------------------------------------------------------------------+
142+
| Byte | Description |
143+
+==========+==================================================================+
144+
| 0 | Event Type (Always 0x01 for HotKey/Notification) |
145+
+----------+------------------------------------------------------------------+
146+
| 1 | Event ID (Corresponds to the Command IDs above) |
147+
+----------+------------------------------------------------------------------+
148+
| 2 | Value (The new state or value of the feature) |
149+
+----------+------------------------------------------------------------------+
150+
151+
Common Event IDs:
152+
-----------------
153+
154+
Note: reserved event ids are not listed there
155+
156+
+----------+------------------------------------------------------------------+
157+
| Event Id | Description |
158+
+==========+==================================================================+
159+
| 4 | AirPlane mode change |
160+
+----------+------------------------------------------------------------------+
161+
| 5 | Keyboard brightness change |
162+
+----------+------------------------------------------------------------------+
163+
| 6 | Touchpad state (enabled/disabled) change |
164+
+----------+------------------------------------------------------------------+
165+
| 7 | FnLock state (enabled/disabled) change |
166+
+----------+------------------------------------------------------------------+
167+
| 8 | Keyboard mode change |
168+
+----------+------------------------------------------------------------------+
169+
| 9 | CapsLock state change |
170+
+----------+------------------------------------------------------------------+
171+
| 13 | NumLock state change |
172+
+----------+------------------------------------------------------------------+
173+
| 14 | ScrollLock state change |
174+
+----------+------------------------------------------------------------------+
175+
| 15 | Performance plan change |
176+
+----------+------------------------------------------------------------------+
177+
| 25 | Display refresh rate change |
178+
+----------+------------------------------------------------------------------+
179+
| 33 | Super key lock state (enabled/disabled) change |
180+
+----------+------------------------------------------------------------------+
181+
| 35 | Open control center key |
182+
+----------+------------------------------------------------------------------+
183+
184+
Implementation Details
185+
======================
186+
187+
Performance Modes
188+
-----------------
189+
Changing the performance mode via Command ID 0x08 (SystemPerMode) affects the
190+
power limits (PL1/PL2) and fan curves managed by the Embedded Controller (EC).
191+
Note that the "Full-speed" and "Performance" mode (1, 3) is typically only
192+
available when the system is connected to a DC power source (not USB-C/PD).
193+
194+
In the driver implementation, switch to performance/full-speed mode without
195+
DC power connected will throw the EOPNOTSUPP error.
196+
197+
Graphics Switching
198+
------------------
199+
The ``GPUMode`` (0x09) allows switching between Hybrid (Muxless) and Discrete
200+
(Muxed) graphics. Changing this value usually requires a system reboot to
201+
take effect in the BIOS/Firmware.
202+
203+
Fan Control
204+
-----------
205+
The system supports both automatic EC control and manual overrides. Command ID
206+
0x14 (``MaxFanSpeedSwitch``) is used to toggle manual control, while ID 0x15
207+
sets the actual PWM duty cycle.

Documentation/wmi/driver-development-guide.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ to matching WMI devices using a struct wmi_device_id table:
7171
.remove = foo_remove, /* optional, devres is preferred */
7272
.shutdown = foo_shutdown, /* optional, called during shutdown */
7373
.notify_new = foo_notify, /* optional, for event handling */
74-
.no_notify_data = true, /* optional, enables events containing no additional data */
74+
.min_event_size = X, /* optional, simplifies event payload size verification */
7575
.no_singleton = true, /* required for new WMI drivers */
7676
};
7777
module_wmi_driver(foo_driver);
@@ -106,7 +106,8 @@ WMI method drivers
106106

107107
WMI drivers can call WMI device methods using wmidev_invoke_method(). For each WMI method
108108
invocation the WMI driver needs to provide the instance number and the method ID, as well as
109-
a buffer with the method arguments and optionally a buffer for the results.
109+
a buffer with the method arguments and optionally a buffer for the results. When calling WMI
110+
methods that do not return any values, wmidev_invoke_procedure() should be used instead.
110111

111112
The layout of said buffers is device-specific and described by the Binary MOF data associated
112113
with a given WMI device. Said Binary MOF data also describes the method ID of a given WMI method
@@ -141,8 +142,10 @@ right before and after calling its remove() or shutdown() callback.
141142
However WMI driver developers should be aware that multiple WMI events can be received concurrently,
142143
so any locking (if necessary) needs to be provided by the WMI driver itself.
143144

144-
In order to be able to receive WMI events containing no additional event data,
145-
the ``no_notify_data`` flag inside struct wmi_driver should be set to ``true``.
145+
The WMI driver can furthermore instruct the WMI driver core to automatically reject WMI events
146+
that contain a undersized event payload by populating the ``min_event_size`` field inside
147+
struct wmi_driver. Setting this field to 0 will thus enable the WMI driver to receive WMI events
148+
without any event payload.
146149

147150
Take a look at drivers/platform/x86/xiaomi-wmi.c for an example WMI event driver.
148151

drivers/gpu/drm/xe/xe_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static void read_residency_counter(struct xe_device *xe, struct xe_mmio *mmio,
4545
u64 residency = 0;
4646
int ret;
4747

48-
ret = xe_pmt_telem_read(to_pci_dev(xe->drm.dev),
48+
ret = xe_pmt_telem_read(xe->drm.dev,
4949
xe_mmio_read32(mmio, PUNIT_TELEMETRY_GUID),
5050
&residency, offset, sizeof(residency));
5151
if (ret != sizeof(residency)) {

drivers/gpu/drm/xe/xe_hwmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ xe_hwmon_energy_get(struct xe_hwmon *hwmon, int channel, long *energy)
506506
if (hwmon->xe->info.platform == XE_BATTLEMAGE) {
507507
u64 pmt_val;
508508

509-
ret = xe_pmt_telem_read(to_pci_dev(hwmon->xe->drm.dev),
509+
ret = xe_pmt_telem_read(hwmon->xe->drm.dev,
510510
xe_mmio_read32(mmio, PUNIT_TELEMETRY_GUID),
511511
&pmt_val, BMG_ENERGY_STATUS_PMT_OFFSET, sizeof(pmt_val));
512512
if (ret != sizeof(pmt_val)) {

drivers/gpu/drm/xe/xe_vsec.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
140140
return 0;
141141
}
142142

143-
int xe_pmt_telem_read(struct pci_dev *pdev, u32 guid, u64 *data, loff_t user_offset,
143+
int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offset,
144144
u32 count)
145145
{
146-
struct xe_device *xe = pdev_to_xe_device(pdev);
146+
struct xe_device *xe = kdev_to_xe_device(dev);
147147
void __iomem *telem_addr = xe->mmio.regs + BMG_TELEMETRY_OFFSET;
148148
u32 mem_region;
149149
u32 offset;
@@ -198,7 +198,6 @@ void xe_vsec_init(struct xe_device *xe)
198198
{
199199
struct intel_vsec_platform_info *info;
200200
struct device *dev = xe->drm.dev;
201-
struct pci_dev *pdev = to_pci_dev(dev);
202201
enum xe_vsec platform;
203202

204203
platform = get_platform_info(xe);
@@ -221,6 +220,6 @@ void xe_vsec_init(struct xe_device *xe)
221220
* Register a VSEC. Cleanup is handled using device managed
222221
* resources.
223222
*/
224-
intel_vsec_register(pdev, info);
223+
intel_vsec_register(dev, info);
225224
}
226225
MODULE_IMPORT_NS("INTEL_VSEC");

drivers/gpu/drm/xe/xe_vsec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
#include <linux/types.h>
88

9-
struct pci_dev;
9+
struct device;
1010
struct xe_device;
1111

1212
void xe_vsec_init(struct xe_device *xe);
13-
int xe_pmt_telem_read(struct pci_dev *pdev, u32 guid, u64 *data, loff_t user_offset, u32 count);
13+
int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offset, u32 count);
1414

1515
#endif

0 commit comments

Comments
 (0)