Skip to content

Commit c9c0543

Browse files
committed
Merge tag 'platform-drivers-x86-v6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver updates from Ilpo Järvinen: "acer-wmi: - Add support for PH14-51, PH16-72, and Nitro AN515-58 - Add proper hwmon support - Improve error handling when reading "gaming system info" - Replace direct EC reads for the current platform profile with WMI calls to handle EC address variations - Replace custom platform_profile cycling with the generic one ACPI: - platform_profile: Major refactoring and improvements - Support registering multiple platform_profile handlers concurrently to avoid the need to quirk which handler takes precedence - Support reporting "custom" profile for cases where the current profile is ambiguous or when settings tweaks are done outside the pre-defined profile - Abstract and layer platform_profile API better using the class_dev and drvdata - Various minor improvements - Add Documentation and kerneldoc amd/hsmp: - Add support for HSMP protocol v7 amd/pmc: - Support AMD 1Ah family 70h - Support STB with Ryzen desktop SoCs amd/pmf: - Support Custom BIOS inputs for PMF TA - Support passing SRA sensor data from AMD SFH (HID) to PMF TA dell-smo8800: - Move SMO88xx quirk away from the generic i2c-i801 driver - Add accelerometer support for Dell Latitude E6330/E6430 and XPS 9550 - Support probing accelerometer for models yet to be listed in the DMI mapping table because ACPI lacks i2c-address for the accelerometer (behind a module parameter because probing might be dangerous) HID: - amd_sfh: Add support for exporting SRA sensor data hp-wmi: - Add fan and thermal support for Victus 16-s1000 input: - Add key for phone linking - i8042: Add context for the i8042 filter to enable cleaning up the filter related global variables from pdx86 drivers lenovo-wmi-camera: - Use SW_CAMERA_LENS_COVER instead of KEY_CAMERA_ACCESS mellanox mlxbf-pmc: - Add support for monitoring cycle count - Add Documentation thinkpad_acpi: - Add support for phone link key tools/power/x86/intel-speed-select: - Fix Turbo Ratio Limit restore x86-android-tables: - Add support for Vexia EDU ATLA 10 Bluetooth and EC battery driver And miscellaneous cleanups / refactoring / improvements" * tag 'platform-drivers-x86-v6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (133 commits) platform/x86: acer-wmi: Fix initialization of last_non_turbo_profile platform/x86: acer-wmi: Ignore AC events platform/mellanox: mlxreg-io: use sysfs_emit() instead of sprintf() platform/mellanox: mlxreg-hotplug: use sysfs_emit() instead of sprintf() platform/mellanox: mlxbf-bootctl: use sysfs_emit() instead of sprintf() platform/x86: hp-wmi: Add fan and thermal profile support for Victus 16-s1000 ACPI: platform_profile: Add a prefix to log messages ACPI: platform_profile: Add documentation ACPI: platform_profile: Clean platform_profile_handler ACPI: platform_profile: Move platform_profile_handler ACPI: platform_profile: Remove platform_profile_handler from exported symbols platform/x86: thinkpad_acpi: Use devm_platform_profile_register() platform/x86: inspur_platform_profile: Use devm_platform_profile_register() platform/x86: hp-wmi: Use devm_platform_profile_register() platform/x86: ideapad-laptop: Use devm_platform_profile_register() platform/x86: dell-pc: Use devm_platform_profile_register() platform/x86: asus-wmi: Use devm_platform_profile_register() platform/x86: amd: pmf: sps: Use devm_platform_profile_register() platform/x86: acer-wmi: Use devm_platform_profile_register() platform/surface: surface_platform_profile: Use devm_platform_profile_register() ...
2 parents 113691c + 0da9a3f commit c9c0543

File tree

92 files changed

+3784
-1672
lines changed

Some content is hidden

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

92 files changed

+3784
-1672
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
What: /sys/class/platform-profile/platform-profile-X/name
2+
Date: March 2025
3+
KernelVersion: 6.14
4+
Description: Name of the class device given by the driver.
5+
6+
RO
7+
8+
What: /sys/class/platform-profile/platform-profile-X/choices
9+
Date: March 2025
10+
KernelVersion: 6.14
11+
Description: This file contains a space-separated list of profiles supported
12+
for this device.
13+
14+
Drivers must use the following standard profile-names:
15+
16+
==================== ========================================
17+
low-power Low power consumption
18+
cool Cooler operation
19+
quiet Quieter operation
20+
balanced Balance between low power consumption
21+
and performance
22+
balanced-performance Balance between performance and low
23+
power consumption with a slight bias
24+
towards performance
25+
performance High performance operation
26+
custom Driver defined custom profile
27+
==================== ========================================
28+
29+
RO
30+
31+
What: /sys/class/platform-profile/platform-profile-X/profile
32+
Date: March 2025
33+
KernelVersion: 6.14
34+
Description: Reading this file gives the current selected profile for this
35+
device. Writing this file with one of the strings from
36+
platform_profile_choices changes the profile to the new value.
37+
38+
This file can be monitored for changes by polling for POLLPRI,
39+
POLLPRI will be signaled on any changes, independent of those
40+
changes coming from a userspace write; or coming from another
41+
source such as e.g. a hotkey triggered profile change handled
42+
either directly by the embedded-controller or fully handled
43+
inside the kernel.
44+
45+
This file may also emit the string 'custom' to indicate
46+
that the driver is using a driver defined custom profile.
47+
48+
RW
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
HID Driver Description
2+
MLNXBFD0 mlxbf-pmc Performance counters (BlueField-1)
3+
MLNXBFD1 mlxbf-pmc Performance counters (BlueField-2)
4+
MLNXBFD2 mlxbf-pmc Performance counters (BlueField-3)
5+
6+
What: /sys/bus/platform/devices/<HID>/hwmon/hwmonX/<block>/event_list
7+
Date: Dec 2020
8+
KernelVersion: 5.10
9+
Contact: "Shravan Kumar Ramani <[email protected]>"
10+
Description:
11+
List of events supported by the counters in the specific block.
12+
It is used to extract the event number or ID associated with
13+
each event.
14+
15+
What: /sys/bus/platform/devices/<HID>/hwmon/hwmonX/<block>/event<N>
16+
Date: Dec 2020
17+
KernelVersion: 5.10
18+
Contact: "Shravan Kumar Ramani <[email protected]>"
19+
Description:
20+
Event monitored by corresponding counter. This is used to
21+
program or read back the event that should be or is currently
22+
being monitored by counter<N>.
23+
24+
What: /sys/bus/platform/devices/<HID>/hwmon/hwmonX/<block>/counter<N>
25+
Date: Dec 2020
26+
KernelVersion: 5.10
27+
Contact: "Shravan Kumar Ramani <[email protected]>"
28+
Description:
29+
Counter value of the event being monitored. This is used to
30+
read the counter value of the event which was programmed using
31+
event<N>. This is also used to clear or reset the counter value
32+
by writing 0 to the counter sysfs.
33+
34+
What: /sys/bus/platform/devices/<HID>/hwmon/hwmonX/<block>/enable
35+
Date: Dec 2020
36+
KernelVersion: 5.10
37+
Contact: "Shravan Kumar Ramani <[email protected]>"
38+
Description:
39+
Start or stop counters. This is used to start the counters
40+
for monitoring the programmed events and also to stop the
41+
counters after the desired duration. Writing value 1 will
42+
start all the counters in the block, and writing 0 will
43+
stop all the counters together.
44+
45+
What: /sys/bus/platform/devices/<HID>/hwmon/hwmonX/<block>/<reg>
46+
Date: Dec 2020
47+
KernelVersion: 5.10
48+
Contact: "Shravan Kumar Ramani <[email protected]>"
49+
Description:
50+
Value of register. This is used to read or reset the registers
51+
where various performance statistics are counted for each block.
52+
Writing 0 to the sysfs will clear the counter, writing any other
53+
value is not allowed.
54+
55+
What: /sys/bus/platform/devices/<HID>/hwmon/hwmonX/<block>/count_clock
56+
Date: Mar 2025
57+
KernelVersion: 6.14
58+
Contact: "Shravan Kumar Ramani <[email protected]>"
59+
Description:
60+
Use a counter for counting cycles. This is used to repurpose/dedicate
61+
any of the counters in the block to counting cycles. Each counter is
62+
represented by a bit (bit 0 for counter0, bit1 for counter1 and so on)
63+
and setting the corresponding bit will reserve that specific counter
64+
for counting cycles and override the event<N> setting.

Documentation/ABI/testing/sysfs-platform_profile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ Description: Reading this file gives the current selected profile for this
3333
source such as e.g. a hotkey triggered profile change handled
3434
either directly by the embedded-controller or fully handled
3535
inside the kernel.
36+
37+
This file may also emit the string 'custom' to indicate
38+
that multiple platform profiles drivers are in use but
39+
have different values. This string can not be written to
40+
this interface and is solely for informational purposes.

Documentation/userspace-api/sysfs-platform_profile.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,41 @@ added. Drivers which wish to introduce new profile names must:
4040
1. Explain why the existing profile names cannot be used.
4141
2. Add the new profile name, along with a clear description of the
4242
expected behaviour, to the sysfs-platform_profile ABI documentation.
43+
44+
"Custom" profile support
45+
========================
46+
The platform_profile class also supports profiles advertising a "custom"
47+
profile. This is intended to be set by drivers when the setttings in the
48+
driver have been modified in a way that a standard profile doesn't represent
49+
the current state.
50+
51+
Multiple driver support
52+
=======================
53+
When multiple drivers on a system advertise a platform profile handler, the
54+
platform profile handler core will only advertise the profiles that are
55+
common between all drivers to the ``/sys/firmware/acpi`` interfaces.
56+
57+
This is to ensure there is no ambiguity on what the profile names mean when
58+
all handlers don't support a profile.
59+
60+
Individual drivers will register a 'platform_profile' class device that has
61+
similar semantics as the ``/sys/firmware/acpi/platform_profile`` interface.
62+
63+
To discover which driver is associated with a platform profile handler the
64+
user can read the ``name`` attribute of the class device.
65+
66+
To discover available profiles from the class interface the user can read the
67+
``choices`` attribute.
68+
69+
If a user wants to select a profile for a specific driver, they can do so
70+
by writing to the ``profile`` attribute of the driver's class device.
71+
72+
This will allow users to set different profiles for different drivers on the
73+
same system. If the selected profile by individual drivers differs the
74+
platform profile handler core will display the profile 'custom' to indicate
75+
that the profiles are not the same.
76+
77+
While the ``platform_profile`` attribute has the value ``custom``, writing a
78+
common profile from ``platform_profile_choices`` to the platform_profile
79+
attribute of the platform profile handler core will set the profile for all
80+
drivers.

Documentation/wmi/driver-development-guide.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ helps in understanding how the WMI device is supposed to work. The path of the A
4141
method associated with a given WMI device can be retrieved using the ``lswmi`` utility
4242
as mentioned above.
4343

44+
If you are attempting to port a driver to Linux and are working on a Windows
45+
system, `WMIExplorer <https://github.com/vinaypamnani/wmie2>`_ can be useful
46+
for inspecting available WMI methods and invoking them directly.
47+
4448
Basic WMI driver structure
4549
--------------------------
4650

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ F: include/linux/pds/
11481148
AMD PMC DRIVER
11491149
M: Shyam Sundar S K <[email protected]>
11501150
1151-
S: Maintained
1151+
S: Supported
11521152
F: drivers/platform/x86/amd/pmc/
11531153

11541154
AMD PMF DRIVER

arch/x86/include/asm/intel_punit_ipc.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,10 @@ typedef enum {
8080

8181
#if IS_ENABLED(CONFIG_INTEL_PUNIT_IPC)
8282

83-
int intel_punit_ipc_simple_command(int cmd, int para1, int para2);
8483
int intel_punit_ipc_command(u32 cmd, u32 para1, u32 para2, u32 *in, u32 *out);
8584

8685
#else
8786

88-
static inline int intel_punit_ipc_simple_command(int cmd,
89-
int para1, int para2)
90-
{
91-
return -ENODEV;
92-
}
93-
9487
static inline int intel_punit_ipc_command(u32 cmd, u32 para1, u32 para2,
9588
u32 *in, u32 *out)
9689
{

arch/x86/include/uapi/asm/amd_hsmp.h

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ enum hsmp_message_ids {
5050
HSMP_GET_METRIC_TABLE_VER, /* 23h Get metrics table version */
5151
HSMP_GET_METRIC_TABLE, /* 24h Get metrics table */
5252
HSMP_GET_METRIC_TABLE_DRAM_ADDR,/* 25h Get metrics table dram address */
53+
HSMP_SET_XGMI_PSTATE_RANGE, /* 26h Set xGMI P-state range */
54+
HSMP_CPU_RAIL_ISO_FREQ_POLICY, /* 27h Get/Set Cpu Iso frequency policy */
55+
HSMP_DFC_ENABLE_CTRL, /* 28h Enable/Disable DF C-state */
56+
HSMP_GET_RAPL_UNITS = 0x30, /* 30h Get scaling factor for energy */
57+
HSMP_GET_RAPL_CORE_COUNTER, /* 31h Get core energy counter value */
58+
HSMP_GET_RAPL_PACKAGE_COUNTER, /* 32h Get package energy counter value */
5359
HSMP_MSG_ID_MAX,
5460
};
5561

@@ -65,14 +71,16 @@ enum hsmp_msg_type {
6571
HSMP_RSVD = -1,
6672
HSMP_SET = 0,
6773
HSMP_GET = 1,
74+
HSMP_SET_GET = 2,
6875
};
6976

7077
enum hsmp_proto_versions {
7178
HSMP_PROTO_VER2 = 2,
7279
HSMP_PROTO_VER3,
7380
HSMP_PROTO_VER4,
7481
HSMP_PROTO_VER5,
75-
HSMP_PROTO_VER6
82+
HSMP_PROTO_VER6,
83+
HSMP_PROTO_VER7
7684
};
7785

7886
struct hsmp_msg_desc {
@@ -300,7 +308,7 @@ static const struct hsmp_msg_desc hsmp_msg_desc_table[]
300308
* HSMP_SET_POWER_MODE, num_args = 1, response_sz = 0
301309
* input: args[0] = power efficiency mode[2:0]
302310
*/
303-
{1, 0, HSMP_SET},
311+
{1, 1, HSMP_SET_GET},
304312

305313
/*
306314
* HSMP_SET_PSTATE_MAX_MIN, num_args = 1, response_sz = 0
@@ -325,6 +333,58 @@ static const struct hsmp_msg_desc hsmp_msg_desc_table[]
325333
* output: args[1] = upper 32 bits of the address
326334
*/
327335
{0, 2, HSMP_GET},
336+
337+
/*
338+
* HSMP_SET_XGMI_PSTATE_RANGE, num_args = 1, response_sz = 0
339+
* input: args[0] = min xGMI p-state[15:8] + max xGMI p-state[7:0]
340+
*/
341+
{1, 0, HSMP_SET},
342+
343+
/*
344+
* HSMP_CPU_RAIL_ISO_FREQ_POLICY, num_args = 1, response_sz = 1
345+
* input: args[0] = set/get policy[31] +
346+
* disable/enable independent control[0]
347+
* output: args[0] = current policy[0]
348+
*/
349+
{1, 1, HSMP_SET_GET},
350+
351+
/*
352+
* HSMP_DFC_ENABLE_CTRL, num_args = 1, response_sz = 1
353+
* input: args[0] = set/get policy[31] + enable/disable DFC[0]
354+
* output: args[0] = current policy[0]
355+
*/
356+
{1, 1, HSMP_SET_GET},
357+
358+
/* RESERVED(0x29-0x2f) */
359+
{0, 0, HSMP_RSVD},
360+
{0, 0, HSMP_RSVD},
361+
{0, 0, HSMP_RSVD},
362+
{0, 0, HSMP_RSVD},
363+
{0, 0, HSMP_RSVD},
364+
{0, 0, HSMP_RSVD},
365+
{0, 0, HSMP_RSVD},
366+
367+
/*
368+
* HSMP_GET_RAPL_UNITS, response_sz = 1
369+
* output: args[0] = tu value[19:16] + esu value[12:8]
370+
*/
371+
{0, 1, HSMP_GET},
372+
373+
/*
374+
* HSMP_GET_RAPL_CORE_COUNTER, num_args = 1, response_sz = 1
375+
* input: args[0] = apic id[15:0]
376+
* output: args[0] = lower 32 bits of energy
377+
* output: args[1] = upper 32 bits of energy
378+
*/
379+
{1, 2, HSMP_GET},
380+
381+
/*
382+
* HSMP_GET_RAPL_PACKAGE_COUNTER, num_args = 0, response_sz = 1
383+
* output: args[0] = lower 32 bits of energy
384+
* output: args[1] = upper 32 bits of energy
385+
*/
386+
{0, 2, HSMP_GET},
387+
328388
};
329389

330390
/* Metrics table (supported only with proto version 6) */

0 commit comments

Comments
 (0)