diff --git a/src/tuxedo_io/tuxedo_io.c b/src/tuxedo_io/tuxedo_io.c index 6955d51..24714fe 100644 --- a/src/tuxedo_io/tuxedo_io.c +++ b/src/tuxedo_io/tuxedo_io.c @@ -251,9 +251,9 @@ static int uw_get_tdp_min(u8 tdp_index) if (tdp_index > 2) return -EINVAL; - if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TUX")) { + if (uw_feats->model == 0x13) { 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]; } else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) { tdp_min = tdp_min_ph4tqx[tdp_index]; @@ -278,9 +278,9 @@ static int uw_get_tdp_max(u8 tdp_index) if (tdp_index > 2) return -EINVAL; - if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TUX")) { + if (uw_feats->model == 0x13) { 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]; } else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) { tdp_max = tdp_max_ph4tqx[tdp_index]; diff --git a/src/uniwill_interfaces.h b/src/uniwill_interfaces.h index 409319c..c161d26 100644 --- a/src/uniwill_interfaces.h +++ b/src/uniwill_interfaces.h @@ -47,6 +47,7 @@ struct uniwill_interface_t { }; struct uniwill_device_features_t { + u8 model; /** * Identification for uniwill_power_profile_v1 * diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index fb0ed3a..518130f 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -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 *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 || 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 uw_feats->uniwill_tdp_config_two = false #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) - || dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TUX") - || dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TRX") + || uw_feats->model == 0x13 + || uw_feats->model == 0x12 || dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX") #endif ;