Change model ID for some models

This commit is contained in:
Christoffer Sandberg 2021-11-23 15:38:45 +01:00
parent 68800661b4
commit 50ea0bb09f
3 changed files with 12 additions and 6 deletions

View file

@ -251,9 +251,9 @@ static int uw_get_tdp_min(u8 tdp_index)
if (tdp_index > 2) if (tdp_index > 2)
return -EINVAL; return -EINVAL;
if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TUX")) { if (uw_feats->model == 0x13) {
tdp_min = tdp_min_ph4tux[tdp_index]; tdp_min = tdp_min_ph4tux[tdp_index];
} else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TRX")) { } else if (uw_feats->model == 0x12) {
tdp_min = tdp_min_ph4trx[tdp_index]; tdp_min = tdp_min_ph4trx[tdp_index];
} else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) { } else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) {
tdp_min = tdp_min_ph4tqx[tdp_index]; tdp_min = tdp_min_ph4tqx[tdp_index];
@ -278,9 +278,9 @@ static int uw_get_tdp_max(u8 tdp_index)
if (tdp_index > 2) if (tdp_index > 2)
return -EINVAL; return -EINVAL;
if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TUX")) { if (uw_feats->model == 0x13) {
tdp_max = tdp_max_ph4tux[tdp_index]; tdp_max = tdp_max_ph4tux[tdp_index];
} else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TRX")) { } else if (uw_feats->model == 0x12) {
tdp_max = tdp_max_ph4trx[tdp_index]; tdp_max = tdp_max_ph4trx[tdp_index];
} else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) { } else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) {
tdp_max = tdp_max_ph4tqx[tdp_index]; tdp_max = tdp_max_ph4tqx[tdp_index];

View file

@ -47,6 +47,7 @@ struct uniwill_interface_t {
}; };
struct uniwill_device_features_t { struct uniwill_device_features_t {
u8 model;
/** /**
* Identification for uniwill_power_profile_v1 * Identification for uniwill_power_profile_v1
* *

View file

@ -185,6 +185,11 @@ EXPORT_SYMBOL(uniwill_get_active_interface_id);
struct uniwill_device_features_t *uniwill_get_device_features(void) struct uniwill_device_features_t *uniwill_get_device_features(void)
{ {
struct uniwill_device_features_t *uw_feats = &uniwill_device_features; struct uniwill_device_features_t *uw_feats = &uniwill_device_features;
u32 status;
status = uniwill_read_ec_ram(0x0740, &uw_feats->model);
if (status != 0)
uw_feats->model = 0;
uw_feats->uniwill_profile_v1_two_profs = false uw_feats->uniwill_profile_v1_two_profs = false
|| dmi_match(DMI_BOARD_NAME, "PF5PU1G") || dmi_match(DMI_BOARD_NAME, "PF5PU1G")
@ -223,8 +228,8 @@ struct uniwill_device_features_t *uniwill_get_device_features(void)
// Device check for two configurable TDPs // Device check for two configurable TDPs
uw_feats->uniwill_tdp_config_two = false uw_feats->uniwill_tdp_config_two = false
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
|| dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TUX") || uw_feats->model == 0x13
|| dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TRX") || uw_feats->model == 0x12
|| dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX") || dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")
#endif #endif
; ;