diff --git a/src/tuxedo_io/tuxedo_io.c b/src/tuxedo_io/tuxedo_io.c index 3eee737..28ffdc8 100644 --- a/src/tuxedo_io/tuxedo_io.c +++ b/src/tuxedo_io/tuxedo_io.c @@ -454,7 +454,7 @@ static long uniwill_ioctl_interface(struct file *file, unsigned int cmd, unsigne result = 0; if (uw_feats->uniwill_profile_v1_two_profs) result = 2; - else if (uw_feats->uniwill_profile_v1_three_profs) + else if (uw_feats->uniwill_profile_v1_three_profs || uw_feats->uniwill_profile_v1_three_profs_leds_only) result = 3; copy_result = copy_to_user((void *) arg, &result, sizeof(result)); break; diff --git a/src/uniwill_interfaces.h b/src/uniwill_interfaces.h index 10ae6e3..409319c 100644 --- a/src/uniwill_interfaces.h +++ b/src/uniwill_interfaces.h @@ -59,6 +59,7 @@ struct uniwill_device_features_t { bool uniwill_profile_v1; bool uniwill_profile_v1_two_profs; bool uniwill_profile_v1_three_profs; + bool uniwill_profile_v1_three_profs_leds_only; /** * Two or three configurable TDP values. Generally two for * low power/more mobile devices and three for heavier workstations diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index 969e3ca..7a60656 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -202,13 +202,18 @@ struct uniwill_device_features_t *uniwill_get_device_features(void) || dmi_match(DMI_BOARD_NAME, "POLARIS1701A2060") || dmi_match(DMI_BOARD_NAME, "POLARIS1701I1650TI") || dmi_match(DMI_BOARD_NAME, "POLARIS1701I2060") + ; + + uw_feats->uniwill_profile_v1_three_profs_leds_only = false // Devices where profile mainly controls power profile LED status +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) || 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") +#endif ; uw_feats->uniwill_profile_v1 = @@ -799,7 +804,7 @@ static int uniwill_keyboard_probe(struct platform_device *dev) u8 data; int status; - uniwill_get_device_features(); + struct uniwill_device_features_t *uw_feats = uniwill_get_device_features(); // FIXME Hard set balanced profile until we have implemented a way to // switch it while tuxedo_io is loaded