Skip to content

Commit 5badf5e

Browse files
VulnXij-intel
authored andcommitted
platform/x86: hp-wmi: Add support for OMEN MAX 16-ak0xxx (8D87)
The HP OMEN MAX 16-ak0xxx (8D87) requires the same WMI queries as other Victus S devices, hence it has been added to the corresponding list. For this reason, platform_profile_victus_s_get_ec() will be called during thermal_profile_setup() and victus_s_powersource_event() to obtain hardware state (platform profile) by reading from the Embedded Controller, however, this particular board's EC does not seem to expose the platform profile value, unlike other boards. Hence EC readback is disabled. Testing on board 8D87 confirmed that platform profile is registered successfully and fan RPMs are readable and controllable. Tested-by: Jinyang Zhu <[email protected]> Signed-off-by: Krishna Chomal <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 9d317a5 commit 5badf5e

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

drivers/platform/x86/hp/hp-wmi.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45E9-BE91-3D44E2C707E4");
4848

4949
enum hp_ec_offsets {
5050
HP_EC_OFFSET_UNKNOWN = 0x00,
51+
HP_NO_THERMAL_PROFILE_OFFSET = 0x01,
5152
HP_VICTUS_S_EC_THERMAL_PROFILE_OFFSET = 0x59,
5253
HP_OMEN_EC_THERMAL_PROFILE_FLAGS_OFFSET = 0x62,
5354
HP_OMEN_EC_THERMAL_PROFILE_TIMER_OFFSET = 0x63,
@@ -127,6 +128,13 @@ static const struct thermal_profile_params omen_v1_legacy_thermal_params = {
127128
.ec_tp_offset = HP_OMEN_EC_THERMAL_PROFILE_OFFSET,
128129
};
129130

131+
static const struct thermal_profile_params omen_v1_no_ec_thermal_params = {
132+
.performance = HP_OMEN_V1_THERMAL_PROFILE_PERFORMANCE,
133+
.balanced = HP_OMEN_V1_THERMAL_PROFILE_DEFAULT,
134+
.low_power = HP_OMEN_V1_THERMAL_PROFILE_DEFAULT,
135+
.ec_tp_offset = HP_NO_THERMAL_PROFILE_OFFSET,
136+
};
137+
130138
/*
131139
* A generic pointer for the currently-active board's thermal profile
132140
* parameters.
@@ -231,6 +239,10 @@ static const struct dmi_system_id victus_s_thermal_profile_boards[] __initconst
231239
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8D41") },
232240
.driver_data = (void *)&victus_s_thermal_params,
233241
},
242+
{
243+
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8D87") },
244+
.driver_data = (void *)&omen_v1_no_ec_thermal_params,
245+
},
234246
{},
235247
};
236248

@@ -1837,7 +1849,8 @@ static int platform_profile_victus_s_get_ec(enum platform_profile_option *profil
18371849
const struct thermal_profile_params *params;
18381850

18391851
params = active_thermal_profile_params;
1840-
if (params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN) {
1852+
if (params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN ||
1853+
params->ec_tp_offset == HP_NO_THERMAL_PROFILE_OFFSET) {
18411854
*profile = active_platform_profile;
18421855
return 0;
18431856
}
@@ -2192,7 +2205,8 @@ static int thermal_profile_setup(struct platform_device *device)
21922205
* behaves like a wrapper around active_platform_profile, to avoid using
21932206
* uninitialized data, we default to PLATFORM_PROFILE_BALANCED.
21942207
*/
2195-
if (active_thermal_profile_params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN) {
2208+
if (active_thermal_profile_params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN ||
2209+
active_thermal_profile_params->ec_tp_offset == HP_NO_THERMAL_PROFILE_OFFSET) {
21962210
active_platform_profile = PLATFORM_PROFILE_BALANCED;
21972211
} else {
21982212
err = platform_profile_victus_s_get_ec(&active_platform_profile);

0 commit comments

Comments
 (0)