From 68800661b4ac972f45fcf28250f4b76dfbe87ab7 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Fri, 12 Nov 2021 23:10:10 +0100 Subject: [PATCH] Modify and add TDP device definitions - Basic 120W upper limit over all - Change min limit to 1W - Add Polaris gen 2 - Add Polaris/Stellaris AMD gen 3 --- src/tuxedo_io/tuxedo_io.c | 31 +++++++++++++++++++++++++++---- src/uniwill_keyboard.h | 8 ++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/tuxedo_io/tuxedo_io.c b/src/tuxedo_io/tuxedo_io.c index 28ffdc8..6955d51 100644 --- a/src/tuxedo_io/tuxedo_io.c +++ b/src/tuxedo_io/tuxedo_io.c @@ -224,18 +224,27 @@ static u32 uw_set_fan_auto(void) /* * TDP boundary definitions per device */ -static int tdp_min_ph4tux[] = { 0x07, 0x07, 0x00 }; +static int tdp_min_ph4tux[] = { 0x01, 0x01, 0x00 }; static int tdp_max_ph4tux[] = { 0x26, 0x26, 0x00 }; -static int tdp_min_ph4trx[] = { 0x07, 0x07, 0x00 }; +static int tdp_min_ph4trx[] = { 0x01, 0x01, 0x00 }; static int tdp_max_ph4trx[] = { 0x32, 0x32, 0x00 }; -static int tdp_min_ph4tqx[] = { 0x07, 0x07, 0x00 }; +static int tdp_min_ph4tqx[] = { 0x01, 0x01, 0x00 }; static int tdp_max_ph4tqx[] = { 0x32, 0x32, 0x00 }; -static int tdp_min_gmxtgxx[] = { 0x00, 0x00, 0x00 }; +static int tdp_min_gmxngxx[] = { 0x01, 0x01, 0x01 }; +static int tdp_max_gmxngxx[] = { 0x78, 0x78, 0x78 }; + +static int tdp_min_gmxmgxx[] = { 0x01, 0x01, 0x01 }; +static int tdp_max_gmxmgxx[] = { 0x78, 0x78, 0x78 }; + +static int tdp_min_gmxtgxx[] = { 0x01, 0x01, 0x01 }; static int tdp_max_gmxtgxx[] = { 0x78, 0x78, 0x78 }; +static int tdp_min_gmxzgxx[] = { 0x01, 0x01, 0x01 }; +static int tdp_max_gmxzgxx[] = { 0x78, 0x78, 0x78 }; + static int uw_get_tdp_min(u8 tdp_index) { int tdp_min = 0; @@ -248,9 +257,16 @@ static int uw_get_tdp_min(u8 tdp_index) tdp_min = tdp_min_ph4trx[tdp_index]; } else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) { tdp_min = tdp_min_ph4tqx[tdp_index]; + } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA02")) { + tdp_min = tdp_min_gmxngxx[tdp_index]; + } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XI02")) { + tdp_min = tdp_min_gmxmgxx[tdp_index]; } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XI03") || dmi_match(DMI_PRODUCT_SKU, "STELLARIS1XI03")) { tdp_min = tdp_min_gmxtgxx[tdp_index]; + } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA03") + || dmi_match(DMI_PRODUCT_SKU, "STELLARIS1XA03")) { + tdp_min = tdp_min_gmxzgxx[tdp_index]; } return tdp_min; @@ -268,9 +284,16 @@ static int uw_get_tdp_max(u8 tdp_index) tdp_max = tdp_max_ph4trx[tdp_index]; } else if (dmi_string_in(DMI_PRODUCT_SERIAL, "PH4TQX")) { tdp_max = tdp_max_ph4tqx[tdp_index]; + } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA02")) { + tdp_max = tdp_max_gmxngxx[tdp_index]; + } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XI02")) { + tdp_max = tdp_max_gmxmgxx[tdp_index]; } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XI03") || dmi_match(DMI_PRODUCT_SKU, "STELLARIS1XI03")) { tdp_max = tdp_max_gmxtgxx[tdp_index]; + } else if ( dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA03") + || dmi_match(DMI_PRODUCT_SKU, "STELLARIS1XA03")) { + tdp_max = tdp_max_gmxzgxx[tdp_index]; } return tdp_max; diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index ffb77ab..fb0ed3a 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -231,12 +231,12 @@ struct uniwill_device_features_t *uniwill_get_device_features(void) // Device check for three configurable TDPs uw_feats->uniwill_tdp_config_three = false - //|| dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA02") - //|| dmi_match(DMI_PRODUCT_SKU, "POLARIS1XI02") - //|| dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA03") + || dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA02") + || dmi_match(DMI_PRODUCT_SKU, "POLARIS1XI02") + || dmi_match(DMI_PRODUCT_SKU, "POLARIS1XA03") || dmi_match(DMI_PRODUCT_SKU, "POLARIS1XI03") || dmi_match(DMI_PRODUCT_SKU, "STELLARIS1XI03") - //|| dmi_match(DMI_PRODUCT_SKU, "STELLARIS1XA03") + || dmi_match(DMI_PRODUCT_SKU, "STELLARIS1XA03") ; return uw_feats;