platform/x86: uniwill-laptop: Introduce device descriptor system
Subsystems (2)
cover platform/x86: uniwill-laptop: Introduce device descriptor system
The first patch of this RFC is based on a PoC by Armin and extended the be able to modify feature bits based on readouts from the EC Memory.
The 2nd patch is a new feature that requires such a modification.
Armin what do you think? Is this a clean approach? Technically the feature bits can be modified arbitrarily, but it should only ever be accessed by the slightly modified getter method, so the risk should be very minimal.
I wonder if the static device_descriptor variable can somehow be skipped, but it doesn't bother to have it there either IMHO.
Armin Wolf (1):
platform/x86: uniwill-laptop: Introduce device descriptor system
Werner Sembach (1):
platform/x86/uniwill: Implement cTGP setting
drivers/platform/x86/uniwill/uniwill-acpi.c | 269 +++++++++++++++++--- 1 file changed, 240 insertions(+), 29 deletions(-)
Signature · 1 line
2.43.0
RFC PATCH 1/2 platform/x86: uniwill-laptop: Introduce device descriptor system
From: Armin Wolf <[email protected]>
Future additions to the driver will depend on device-specific initialization steps. Extend the DMI-based feature detection system to include device descriptors. Each descriptor contains a bitmap of supported features and a set of callback for performing device-specific initialization.
--- drivers/platform/x86/uniwill/uniwill-acpi.c | 156 ++++++++++++++++---- 1 file changed, 130 insertions(+), 26 deletions(-)
drivers/platform/x86/uniwill/uniwill-acpi.c +130 -26
@@ -334,6 +334,7 @@ struct uniwill_data {struct mutex input_lock;/* Protects input sequence during notify */ struct input_dev *input_device;struct notifier_block nb; +unsigned int features; };struct uniwill_battery_entry {
@@ -341,12 +342,21 @@ struct uniwill_battery_entry {struct power_supply *battery; }; +struct uniwill_device_descriptor { +unsigned int features; +/* Executed during driver probing */ +int (*probe)(struct uniwill_data *data); +}; +static bool force;module_param_unsafe (force, bool,0 );MODULE_PARM_DESC (force,"Force loading without checking for supported devices\n" ); -/* Feature bitmask since the associated registers are not reliable */ -static unsigned int supported_features; +/* +* Contains device specific data like the feature bitmap since +* the associated registers are not always reliable. +*/ +static struct uniwill_device_descriptor device_descriptor__ro_after_init ;static const char *const uniwill_temp_labels[] = {"CPU" ,
@@ -411,6 +421,12 @@ static const struct key_entry uniwill_keymap[] = { { KE_END } }; +static inline bool uniwill_device_supports (struct uniwill_data *data, +unsigned int feature_mask) +{ +return data->features & feature_mask; +} +static int uniwill_ec_reg_write (void *context,unsigned int reg,unsigned int val) {union acpi_object params[2 ] = {
@@ -799,24 +815,27 @@ static struct attribute *uniwill_attrs[] = {static umode_t uniwill_attr_is_visible (struct kobject *kobj,struct attribute *attr,int n) { +struct device *dev =kobj_to_dev (kobj); +struct uniwill_data *data =dev_get_drvdata (dev); +if (attr == &dev_attr_fn_lock_toggle_enable.attr) { -if (supported_features &UNIWILL_FEATURE_FN_LOCK_TOGGLE ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_FN_LOCK_TOGGLE ))return attr->mode; }if (attr == &dev_attr_super_key_toggle_enable.attr) { -if (supported_features &UNIWILL_FEATURE_SUPER_KEY_TOGGLE ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_SUPER_KEY_TOGGLE ))return attr->mode; }if (attr == &dev_attr_touchpad_toggle_enable.attr) { -if (supported_features &UNIWILL_FEATURE_TOUCHPAD_TOGGLE ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_TOUCHPAD_TOGGLE ))return attr->mode; }if (attr == &dev_attr_rainbow_animation.attr || attr == &dev_attr_breathing_in_suspend.attr) { -if (supported_features &UNIWILL_FEATURE_LIGHTBAR ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_LIGHTBAR ))return attr->mode; }
@@ -944,7 +963,7 @@ static int uniwill_hwmon_init(struct uniwill_data *data) {struct device *hdev; -if (!(supported_features &UNIWILL_FEATURE_HWMON )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_HWMON ))return 0 ; hdev = devm_hwmon_device_register_with_info(data->dev, "uniwill", data,
@@ -1019,7 +1038,7 @@ static int uniwill_led_init(struct uniwill_data *data)unsigned int value;int ret; -if (!(supported_features &UNIWILL_FEATURE_LIGHTBAR )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_LIGHTBAR ))return 0 ; ret =devm_mutex_init (data->dev, &data->led_lock);
@@ -1232,7 +1251,7 @@ static int uniwill_battery_init(struct uniwill_data *data) {int ret; -if (!(supported_features &UNIWILL_FEATURE_BATTERY )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_BATTERY ))return 0 ; ret =devm_mutex_init (data->dev, &data->battery_lock);
@@ -1361,6 +1380,19 @@ static int uniwill_probe(struct platform_device *pdev)if (ret <0 )return ret; + data->features = device_descriptor.features; + +/* +* Some devices might need to perform some device-specific initialization steps +* before the supported features are initialized. Because of this we have to call +* this callback just after the EC itself was initialized. +*/ +if (device_descriptor.probe) { + ret = device_descriptor.probe (data); +if (ret <0 ) +return ret; + } + ret =uniwill_battery_init (data);if (ret <0 )return ret;
@@ -1385,7 +1417,7 @@ static void uniwill_shutdown(struct platform_device *pdev)static int uniwill_suspend_keyboard (struct uniwill_data *data) { -if (!(supported_features &UNIWILL_FEATURE_SUPER_KEY_TOGGLE )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_SUPER_KEY_TOGGLE ))return 0 ;/*
@@ -1397,7 +1429,7 @@ static int uniwill_suspend_keyboard(struct uniwill_data *data)static int uniwill_suspend_battery (struct uniwill_data *data) { -if (!(supported_features &UNIWILL_FEATURE_BATTERY )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_BATTERY ))return 0 ;/*
@@ -1432,7 +1464,7 @@ static int uniwill_resume_keyboard(struct uniwill_data *data)unsigned int value;int ret; -if (!(supported_features &UNIWILL_FEATURE_SUPER_KEY_TOGGLE )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_SUPER_KEY_TOGGLE ))return 0 ; ret =regmap_read (data->regmap,EC_ADDR_SWITCH_STATUS , &value);
@@ -1448,7 +1480,7 @@ static int uniwill_resume_keyboard(struct uniwill_data *data)static int uniwill_resume_battery (struct uniwill_data *data) { -if (!(supported_features &UNIWILL_FEATURE_BATTERY )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_BATTERY ))return 0 ; return regmap_update_bits(data->regmap, EC_ADDR_CHARGE_CTRL, CHARGE_CTRL_MASK,
@@ -1496,6 +1528,25 @@ static struct platform_driver uniwill_driver = { .shutdown = uniwill_shutdown, }; +struct uniwill_device_descriptor lapac71h_descriptor__initdata = { + .features =UNIWILL_FEATURE_FN_LOCK_TOGGLE | +UNIWILL_FEATURE_SUPER_KEY_TOGGLE | +UNIWILL_FEATURE_TOUCHPAD_TOGGLE | +UNIWILL_FEATURE_BATTERY | +UNIWILL_FEATURE_HWMON +}; + +struct uniwill_device_descriptor lapkc71f_descriptor__initdata = { + .features =UNIWILL_FEATURE_FN_LOCK_TOGGLE | +UNIWILL_FEATURE_SUPER_KEY_TOGGLE | +UNIWILL_FEATURE_TOUCHPAD_TOGGLE | +UNIWILL_FEATURE_LIGHTBAR | +UNIWILL_FEATURE_BATTERY | +UNIWILL_FEATURE_HWMON +}; + +struct uniwill_device_descriptor void_descriptor__initdata = {}; +static const struct dmi_system_id uniwill_dmi_table[]__initconst = { { .ident ="XMG FUSION 15" ,
@@ -1503,6 +1554,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"SchenkerTechnologiesGmbH" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "LAPQC71A"), }, + .driver_data = &void_descriptor, }, { .ident = "XMG FUSION 15",
@@ -1510,6 +1562,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"SchenkerTechnologiesGmbH" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "LAPQC71B"), }, + .driver_data = &void_descriptor, }, { .ident = "Intel NUC x15",
@@ -1517,11 +1570,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel(R) Client Systems" ), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LAPAC71H"), }, - .driver_data = (void *)(UNIWILL_FEATURE_FN_LOCK_TOGGLE | -UNIWILL_FEATURE_SUPER_KEY_TOGGLE | -UNIWILL_FEATURE_TOUCHPAD_TOGGLE | -UNIWILL_FEATURE_BATTERY | - UNIWILL_FEATURE_HWMON), + .driver_data = &lapac71h_descriptor, }, { .ident = "Intel NUC x15",
@@ -1529,12 +1578,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel(R) Client Systems" ), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LAPKC71F"), }, - .driver_data = (void *)(UNIWILL_FEATURE_FN_LOCK_TOGGLE | -UNIWILL_FEATURE_SUPER_KEY_TOGGLE | -UNIWILL_FEATURE_TOUCHPAD_TOGGLE | -UNIWILL_FEATURE_LIGHTBAR | -UNIWILL_FEATURE_BATTERY | - UNIWILL_FEATURE_HWMON), + .driver_data = &lapkc71f_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14 Gen6 Intel",
@@ -1542,6 +1586,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTxX1"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14 Gen6 Intel",
@@ -1549,6 +1594,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",
@@ -1556,6 +1602,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",
@@ -1563,6 +1610,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
@@ -1570,6 +1618,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
@@ -1577,6 +1626,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",
@@ -1584,6 +1634,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",
@@ -1591,6 +1642,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GXxHRXx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen9 Intel/Commodore Omnia-Book 15 Gen9",
@@ -1598,6 +1650,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GXxMRXx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen10 AMD",
@@ -1605,6 +1658,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxHP4NAx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen10 AMD",
@@ -1612,6 +1666,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 15 Gen10 Intel",
@@ -1619,6 +1674,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxAR4NAx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 15 Gen10 AMD",
@@ -1626,6 +1682,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X5KK45xS_X5SP45xS"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 16 Gen10 AMD",
@@ -1633,6 +1690,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6HP45xU"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 16 Gen10 AMD",
@@ -1640,6 +1698,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6KK45xU_X6SP45xU"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 15 Gen10 Intel",
@@ -1647,6 +1706,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X5AR45xS"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 16 Gen10 Intel",
@@ -1654,6 +1714,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR55xU"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 AMD",
@@ -1661,6 +1722,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501A1650TI"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 AMD",
@@ -1668,6 +1730,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501A2060"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 AMD",
@@ -1675,6 +1738,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701A1650TI"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 AMD",
@@ -1682,6 +1746,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701A2060"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 Intel",
@@ -1689,6 +1754,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501I1650TI"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 Intel",
@@ -1696,6 +1762,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501I2060"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 Intel",
@@ -1703,6 +1770,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701I1650TI"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 Intel",
@@ -1710,6 +1778,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701I2060"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Trinity 15 Intel Gen1",
@@ -1717,6 +1786,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "TRINITY1501I"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Trinity 17 Intel Gen1",
@@ -1724,6 +1794,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "TRINITY1701I"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen2 AMD",
@@ -1731,6 +1802,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen2 Intel",
@@ -1738,6 +1810,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",
@@ -1745,6 +1818,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",
@@ -1752,6 +1826,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",
@@ -1759,6 +1834,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 15 Gen4 Intel",
@@ -1766,6 +1842,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen5 AMD",
@@ -1773,6 +1850,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen5 AMD",
@@ -1780,6 +1858,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",
@@ -1787,6 +1866,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",
@@ -1794,6 +1874,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",
@@ -1801,6 +1882,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
@@ -1808,6 +1890,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
@@ -1815,6 +1898,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",
@@ -1822,6 +1906,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 AMD",
@@ -1829,6 +1914,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",
@@ -1836,6 +1922,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",
@@ -1843,6 +1930,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Pulse 14 Gen1 AMD",
@@ -1850,6 +1938,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PULSE1401"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Pulse 15 Gen1 AMD",
@@ -1857,6 +1946,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PULSE1501"), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Pulse 15 Gen2 AMD",
@@ -1864,6 +1954,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PF5LUXG"), }, + .driver_data = &void_descriptor, }, { } };
@@ -1871,6 +1962,7 @@ MODULE_DEVICE_TABLE(dmi, uniwill_dmi_table);static int __init uniwill_init (void ) { +const struct uniwill_device_descriptor *descriptor;const struct dmi_system_id *id;int ret;
@@ -1880,10 +1972,22 @@ static int __init uniwill_init(void)return -ENODEV ;/* Assume that the device supports all features */ - supported_features =UINT_MAX ; + device_descriptor.features =UINT_MAX ;pr_warn ("Loading on a potentially unsupported device\n" ); }else { - supported_features = (uintptr_t )id->driver_data; +/* +* Some devices might support additional features depending on +* the BIOS version/date, so we call this callback to let them +* modify their device descriptor accordingly. +*/ +if (id->callback) { + ret = id->callback (id); +if (ret <0 ) +return ret; + } + + descriptor = id->driver_data; + device_descriptor = *descriptor; } ret =platform_driver_register (&uniwill_driver);
Signature · 1 line
2.43.0
Am 25.11.25 um 14:49 schrieb Werner Sembach:
Quoted 20 lines
From: Armin Wolf <[email protected]>
Future additions to the driver will depend on device-specific initialization steps. Extend the DMI-based feature detection system to include device descriptors. Each descriptor contains a bitmap of supported features and a set of callback for performing device-specific initialization.
Signed-off-by Armin Wolf <[email protected]>Co-developed-by Werner Sembach <[email protected]>Signed-off-by Werner Sembach <[email protected]>--- drivers/platform/x86/uniwill/uniwill-acpi.c | 156 ++++++++++++++++---- 1 file changed, 130 insertions(+), 26 deletions(-)drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0
drivers/platform/x86/uniwill/uniwill-acpi.c struct uniwill_data { · line 337
Quoted 4 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -334,6 +334,7 @@ struct uniwill_data {struct mutex input_lock;/* Protects input sequence during notify */ struct input_dev *input_device;struct notifier_block nb; +unsigned int features;
Hi,
could you please move this field just below the regmap field? This would be a good way to signal the importance of said field for the remaining fields.
Quoted 28 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +11
-2};struct uniwill_battery_entry {@@ -341,12 +342,21 @@ struct uniwill_battery_entry {struct power_supply *battery; }; +struct uniwill_device_descriptor { +unsigned int features; +/* Executed during driver probing */ +int (*probe)(struct uniwill_data *data); +}; +static bool force;module_param_unsafe (force, bool,0 );MODULE_PARM_DESC (force,"Force loading without checking for supported devices\n" ); -/* Feature bitmask since the associated registers are not reliable */ -static unsigned int supported_features; +/* +* Contains device specific data like the feature bitmap since +* the associated registers are not always reliable. +*/ +static struct uniwill_device_descriptor device_descriptor__ro_after_init ;static const char *const uniwill_temp_labels[] = {"CPU" ,
drivers/platform/x86/uniwill/uniwill-acpi.c static const struct key_entry uniwill_keymap[] = { · line 427
Quoted 7 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +4
-0@@ -411,6 +421,12 @@ static const struct key_entry uniwill_keymap[] = { { KE_END } }; +static inline bool uniwill_device_supports (struct uniwill_data *data, +unsigned int feature_mask) +{ +return data->features & feature_mask;
Do we want to support for testing multiple features at once? If yes then please change this to:
return (data->features & feature_mask) == feature_mask;
If no then please rename "feature_mask" to "feature".
Quoted 132 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +37
-11+} +static int uniwill_ec_reg_write (void *context,unsigned int reg,unsigned int val) {union acpi_object params[2 ] = {@@ -799,24 +815,27 @@ static struct attribute *uniwill_attrs[] = {static umode_t uniwill_attr_is_visible (struct kobject *kobj,struct attribute *attr,int n) { +struct device *dev =kobj_to_dev (kobj); +struct uniwill_data *data =dev_get_drvdata (dev); +if (attr == &dev_attr_fn_lock_toggle_enable.attr) { -if (supported_features &UNIWILL_FEATURE_FN_LOCK_TOGGLE ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_FN_LOCK_TOGGLE ))return attr->mode; }if (attr == &dev_attr_super_key_toggle_enable.attr) { -if (supported_features &UNIWILL_FEATURE_SUPER_KEY_TOGGLE ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_SUPER_KEY_TOGGLE ))return attr->mode; }if (attr == &dev_attr_touchpad_toggle_enable.attr) { -if (supported_features &UNIWILL_FEATURE_TOUCHPAD_TOGGLE ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_TOUCHPAD_TOGGLE ))return attr->mode; }if (attr == &dev_attr_rainbow_animation.attr || attr == &dev_attr_breathing_in_suspend.attr) { -if (supported_features &UNIWILL_FEATURE_LIGHTBAR ) +if (uniwill_device_supports (data,UNIWILL_FEATURE_LIGHTBAR ))return attr->mode; }@@ -944,7 +963,7 @@ static int uniwill_hwmon_init(struct uniwill_data *data) {struct device *hdev; -if (!(supported_features &UNIWILL_FEATURE_HWMON )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_HWMON ))return 0 ; hdev = devm_hwmon_device_register_with_info(data->dev, "uniwill", data,@@ -1019,7 +1038,7 @@ static int uniwill_led_init(struct uniwill_data *data)unsigned int value;int ret; -if (!(supported_features &UNIWILL_FEATURE_LIGHTBAR )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_LIGHTBAR ))return 0 ; ret =devm_mutex_init (data->dev, &data->led_lock);@@ -1232,7 +1251,7 @@ static int uniwill_battery_init(struct uniwill_data *data) {int ret; -if (!(supported_features &UNIWILL_FEATURE_BATTERY )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_BATTERY ))return 0 ; ret =devm_mutex_init (data->dev, &data->battery_lock);@@ -1361,6 +1380,19 @@ static int uniwill_probe(struct platform_device *pdev)if (ret <0 )return ret; + data->features = device_descriptor.features; + +/* +* Some devices might need to perform some device-specific initialization steps +* before the supported features are initialized. Because of this we have to call +* this callback just after the EC itself was initialized. +*/ +if (device_descriptor.probe) { + ret = device_descriptor.probe (data); +if (ret <0 ) +return ret; + } + ret =uniwill_battery_init (data);if (ret <0 )return ret;@@ -1385,7 +1417,7 @@ static void uniwill_shutdown(struct platform_device *pdev)static int uniwill_suspend_keyboard (struct uniwill_data *data) { -if (!(supported_features &UNIWILL_FEATURE_SUPER_KEY_TOGGLE )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_SUPER_KEY_TOGGLE ))return 0 ;/* @@ -1397,7 +1429,7 @@ static int uniwill_suspend_keyboard(struct uniwill_data *data)static int uniwill_suspend_battery (struct uniwill_data *data) { -if (!(supported_features &UNIWILL_FEATURE_BATTERY )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_BATTERY ))return 0 ;/* @@ -1432,7 +1464,7 @@ static int uniwill_resume_keyboard(struct uniwill_data *data)unsigned int value;int ret; -if (!(supported_features &UNIWILL_FEATURE_SUPER_KEY_TOGGLE )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_SUPER_KEY_TOGGLE ))return 0 ; ret =regmap_read (data->regmap,EC_ADDR_SWITCH_STATUS , &value);@@ -1448,7 +1480,7 @@ static int uniwill_resume_keyboard(struct uniwill_data *data)static int uniwill_resume_battery (struct uniwill_data *data) { -if (!(supported_features &UNIWILL_FEATURE_BATTERY )) +if (!uniwill_device_supports (data,UNIWILL_FEATURE_BATTERY ))return 0 ; return regmap_update_bits(data->regmap, EC_ADDR_CHARGE_CTRL, CHARGE_CTRL_MASK,@@ -1496,6 +1528,25 @@ static struct platform_driver uniwill_driver = { .shutdown = uniwill_shutdown, }; +struct uniwill_device_descriptor lapac71h_descriptor__initdata = { + .features =UNIWILL_FEATURE_FN_LOCK_TOGGLE | +UNIWILL_FEATURE_SUPER_KEY_TOGGLE | +UNIWILL_FEATURE_TOUCHPAD_TOGGLE | +UNIWILL_FEATURE_BATTERY | +UNIWILL_FEATURE_HWMON +}; +
drivers/platform/x86/uniwill/uniwill-acpi.c static struct platform_driver uniwill_driver = { · line 1548
Quoted 10 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +10
-0+struct uniwill_device_descriptor lapkc71f_descriptor__initdata = { + .features =UNIWILL_FEATURE_FN_LOCK_TOGGLE | +UNIWILL_FEATURE_SUPER_KEY_TOGGLE | +UNIWILL_FEATURE_TOUCHPAD_TOGGLE | +UNIWILL_FEATURE_LIGHTBAR | +UNIWILL_FEATURE_BATTERY | +UNIWILL_FEATURE_HWMON +}; + +struct uniwill_device_descriptor void_descriptor__initdata = {};
void_descriptor -> empty_descriptor.
With the above issues being fixed:
Quoted 456 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +67
-13+static const struct dmi_system_id uniwill_dmi_table[]__initconst = { { .ident ="XMG FUSION 15" ,@@ -1503,6 +1554,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"SchenkerTechnologiesGmbH" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"LAPQC71A" ), }, + .driver_data = &void_descriptor, }, { .ident = "XMG FUSION 15",@@ -1510,6 +1562,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"SchenkerTechnologiesGmbH" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"LAPQC71B" ), }, + .driver_data = &void_descriptor, }, { .ident = "Intel NUC x15",@@ -1517,11 +1570,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel(R) Client Systems" ),DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"LAPAC71H" ), }, - .driver_data = (void *)(UNIWILL_FEATURE_FN_LOCK_TOGGLE | -UNIWILL_FEATURE_SUPER_KEY_TOGGLE | -UNIWILL_FEATURE_TOUCHPAD_TOGGLE | -UNIWILL_FEATURE_BATTERY | - UNIWILL_FEATURE_HWMON), + .driver_data = &lapac71h_descriptor, }, { .ident = "Intel NUC x15",@@ -1529,12 +1578,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel(R) Client Systems" ),DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"LAPKC71F" ), }, - .driver_data = (void *)(UNIWILL_FEATURE_FN_LOCK_TOGGLE | -UNIWILL_FEATURE_SUPER_KEY_TOGGLE | -UNIWILL_FEATURE_TOUCHPAD_TOGGLE | -UNIWILL_FEATURE_LIGHTBAR | -UNIWILL_FEATURE_BATTERY | - UNIWILL_FEATURE_HWMON), + .driver_data = &lapkc71f_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14 Gen6 Intel",@@ -1542,6 +1586,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PHxTxX1" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14 Gen6 Intel",@@ -1549,6 +1594,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PHxTQx1" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",@@ -1556,6 +1602,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PHxARX1_PHxAQF1" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",@@ -1563,6 +1610,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PH6AG01_PH6AQ71_PH6AQI1" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",@@ -1570,6 +1618,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PH4PRX1_PH6PRX1" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",@@ -1577,6 +1626,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PH4PG31" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",@@ -1584,6 +1634,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PH6PG01_PH6PG71" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",@@ -1591,6 +1642,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GXxHRXx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen9 Intel/Commodore Omnia-Book 15 Gen9",@@ -1598,6 +1650,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GXxMRXx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen10 AMD",@@ -1605,6 +1658,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"XxHP4NAx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen10 AMD",@@ -1612,6 +1666,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"XxKK4NAx_XxSP4NAx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 15 Gen10 Intel",@@ -1619,6 +1674,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"XxAR4NAx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 15 Gen10 AMD",@@ -1626,6 +1682,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X5KK45xS_X5SP45xS" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 16 Gen10 AMD",@@ -1633,6 +1690,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6HP45xU" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 16 Gen10 AMD",@@ -1640,6 +1698,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6KK45xU_X6SP45xU" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 15 Gen10 Intel",@@ -1647,6 +1706,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X5AR45xS" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO InfinityBook Max 16 Gen10 Intel",@@ -1654,6 +1714,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6AR55xU" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 AMD",@@ -1661,6 +1722,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1501A1650TI" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 AMD",@@ -1668,6 +1730,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1501A2060" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 AMD",@@ -1675,6 +1738,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1701A1650TI" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 AMD",@@ -1682,6 +1746,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1701A2060" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 Intel",@@ -1689,6 +1754,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1501I1650TI" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15 Gen1 Intel",@@ -1696,6 +1762,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1501I2060" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 Intel",@@ -1703,6 +1770,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1701I1650TI" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 17 Gen1 Intel",@@ -1710,6 +1778,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"POLARIS1701I2060" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Trinity 15 Intel Gen1",@@ -1717,6 +1786,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"TRINITY1501I" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Trinity 17 Intel Gen1",@@ -1724,6 +1794,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"TRINITY1701I" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen2 AMD",@@ -1731,6 +1802,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxMGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen2 Intel",@@ -1738,6 +1810,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxNGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",@@ -1745,6 +1818,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxZGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",@@ -1752,6 +1826,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxTGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",@@ -1759,6 +1834,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxRGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 15 Gen4 Intel",@@ -1766,6 +1842,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxAGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen5 AMD",@@ -1773,6 +1850,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxXGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen5 AMD",@@ -1780,6 +1858,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM6XGxX" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",@@ -1787,6 +1866,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxPXxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",@@ -1794,6 +1874,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxHGxx" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",@@ -1801,6 +1882,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM5IXxA" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",@@ -1808,6 +1890,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM6IXxB_MB1" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",@@ -1815,6 +1898,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM6IXxB_MB2" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",@@ -1822,6 +1906,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM7IXxN" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 AMD",@@ -1829,6 +1914,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6FR5xxY" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",@@ -1836,6 +1922,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6AR5xxY" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",@@ -1843,6 +1930,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6AR5xxY_mLED" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Pulse 14 Gen1 AMD",@@ -1850,6 +1938,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PULSE1401" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Pulse 15 Gen1 AMD",@@ -1857,6 +1946,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PULSE1501" ), }, + .driver_data = &void_descriptor, }, { .ident = "TUXEDO Pulse 15 Gen2 AMD",@@ -1864,6 +1954,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PF5LUXG"), }, + .driver_data = &void_descriptor, }, { } };@@ -1871,6 +1962,7 @@ MODULE_DEVICE_TABLE(dmi, uniwill_dmi_table);static int __init uniwill_init (void ) { +const struct uniwill_device_descriptor *descriptor;const struct dmi_system_id *id;int ret;@@ -1880,10 +1972,22 @@ static int __init uniwill_init(void)return -ENODEV ;/* Assume that the device supports all features */ - supported_features =UINT_MAX ; + device_descriptor.features =UINT_MAX ;pr_warn ("Loading on a potentially unsupported device\n" ); }else { - supported_features = (uintptr_t )id->driver_data; +/* +* Some devices might support additional features depending on +* the BIOS version/date, so we call this callback to let them +* modify their device descriptor accordingly. +*/ +if (id->callback) { + ret = id->callback (id); +if (ret <0 ) +return ret; + } + + descriptor = id->driver_data; + device_descriptor = *descriptor; } ret =platform_driver_register (&uniwill_driver);
Am 25.11.25 um 21:18 schrieb Armin Wolf:
Quoted 29 lines
Am 25.11.25 um 14:49 schrieb Werner Sembach:
Quoted 20 lines
From: Armin Wolf <[email protected]>
Future additions to the driver will depend on device-specific initialization steps. Extend the DMI-based feature detection system to include device descriptors. Each descriptor contains a bitmap of supported features and a set of callback for performing device-specific initialization.
Signed-off-by Armin Wolf <[email protected]>Co-developed-by Werner Sembach <[email protected]>Signed-off-by Werner Sembach <[email protected]>---
drivers/platform/x86/uniwill/uniwill-acpi.c| 156 ++++++++++++++++----1 file changed, 130 insertions(+), 26 deletions(-)drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -334,6 +334,7 @@ struct uniwill_data {Quoted 4 lines
struct mutex input_lock; /* Protects input sequence during notify */ struct
input_dev*input_device;
structnotifier_blocknb;
+ unsigned int features;Hi,
Quoted 2 lines
could you please move this field just below the regmap field? This would be a good way to signal the importance of said field for the remaining fields.
ack
Quoted 35 lines
Quoted 25 lines
};
structuniwill_battery_entry{drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0@@ -341,12 +342,21 @@ struct uniwill_battery_entry { struct power_supply *battery; }; +struct uniwill_device_descriptor { + unsigned int features; + /* Executed during driver probing */ + int (*probe)(struct uniwill_data *data); +}; + static bool force; module_param_unsafe(force, bool, 0); MODULE_PARM_DESC(force, "Force loading without checking for supported devices\n");-/* Feature bitmask since the associated registers are not reliable */
drivers/platform/x86/uniwill/uniwill-acpi.c +5
-1-static unsigned int supported_features; +/* +* Contains device specific data like the feature bitmap since +* the associated registers are not always reliable. +*/ +static struct uniwill_device_descriptor device_descriptor__ro_after_init ;static const char * const uniwill_temp_labels[] = { "CPU",
drivers/platform/x86/uniwill/uniwill-acpi.c static const struct key_entry uniwill_keymap[] = { · line 426
Quoted 6 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +3
-0@@ -411,6 +421,12 @@ static const struct key_entry uniwill_keymap[] = { { KE_END } }; +static inline bool uniwill_device_supports(struct uniwill_data *data, + unsigned int feature_mask) +{ + return data->features & feature_mask;Do we want to support for testing multiple features at once? If yes then please change this to:
Quoted 3 lines
return (
data->features&feature_mask) ==feature_mask;If no then please rename "
feature_mask" to "feature".
sounds usefull, will do
Quoted 121 lines
Quoted 121 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +8
-3+} + static int uniwill_ec_reg_write(void *context, unsigned int reg, unsigned int val) { union acpi_object params[2] = {@@ -799,24 +815,27 @@ static struct attribute *uniwill_attrs[] = { static umode_t uniwill_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n) { + struct device *dev = kobj_to_dev(kobj); + struct uniwill_data *data = dev_get_drvdata(dev); + if (attr == &dev_attr_fn_lock_toggle_enable.attr) { - if (supported_features & UNIWILL_FEATURE_FN_LOCK_TOGGLE) + if (uniwill_device_supports(data, UNIWILL_FEATURE_FN_LOCK_TOGGLE)) return attr->mode; } if (attr == &dev_attr_super_key_toggle_enable.attr) { - if (supported_features & UNIWILL_FEATURE_SUPER_KEY_TOGGLE) + if (uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) return attr->mode; } if (attr == &dev_attr_touchpad_toggle_enable.attr) { - if (supported_features & UNIWILL_FEATURE_TOUCHPAD_TOGGLE) + if (uniwill_device_supports(data, UNIWILL_FEATURE_TOUCHPAD_TOGGLE)) return attr->mode; }if (attr == &dev_attr_rainbow_animation.attr ||
attr == &dev_attr_breathing_in_suspend.attr) {
- if (supported_features&UNIWILL_FEATURE_LIGHTBAR)
+ if (uniwill_device_supports(data, UNIWILL_FEATURE_LIGHTBAR)) returnattr->mode;
}
@@ -944,7 +963,7 @@ static intuniwill_hwmon_init(struct uniwill_data *data){
struct device *hdev;
- if (!(supported_features &UNIWILL_FEATURE_HWMON))
+ if (!uniwill_device_supports(data,UNIWILL_FEATURE_HWMON)) return 0;
hdev = devm_hwmon_device_register_with_info(data->dev, "uniwill", data,drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0@@ -1019,7 +1038,7 @@ static int uniwill_led_init(struct uniwill_data *data) unsigned int value; int ret; - if (!(supported_features & UNIWILL_FEATURE_LIGHTBAR)) + if (!uniwill_device_supports(data, UNIWILL_FEATURE_LIGHTBAR)) return 0; ret = devm_mutex_init(data->dev, &data->led_lock);@@ -1232,7 +1251,7 @@ static int uniwill_battery_init(struct uniwill_data *data) { int ret; - if (!(supported_features & UNIWILL_FEATURE_BATTERY)) + if (!uniwill_device_supports(data, UNIWILL_FEATURE_BATTERY)) return 0; ret = devm_mutex_init(data->dev, &data->battery_lock);@@ -1361,6 +1380,19 @@ static int uniwill_probe(struct platform_device *pdev) if (ret < 0) return ret; + data->features = device_descriptor.features; + + /* +* Some devices might need to perform some device-specific initialization steps
+ * before the supported features are initialized. Because of this we have to call
+ * this callback just after the EC itself was initialized. + */
+ if (device_descriptor.probe) {
+ ret =device_descriptor.probe(data);
+ if (ret < 0)
+ return ret;
+ }
+
ret =uniwill_battery_init(data);
if (ret < 0)
return ret;drivers/platform/x86/uniwill/uniwill-acpi.c +15
-3@@ -1385,7 +1417,7 @@ static void uniwill_shutdown(struct platform_device *pdev) static int uniwill_suspend_keyboard(struct uniwill_data *data) { - if (!(supported_features & UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) + if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) return 0; /*@@ -1397,7 +1429,7 @@ static int uniwill_suspend_keyboard(struct uniwill_data *data) static int uniwill_suspend_battery(struct uniwill_data *data) { - if (!(supported_features & UNIWILL_FEATURE_BATTERY)) + if (!uniwill_device_supports(data, UNIWILL_FEATURE_BATTERY)) return 0; /*@@ -1432,7 +1464,7 @@ static int uniwill_resume_keyboard(struct uniwill_data *data) unsigned int value; int ret; - if (!(supported_features & UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) + if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) return 0; ret = regmap_read(data->regmap, EC_ADDR_SWITCH_STATUS, &value);@@ -1448,7 +1480,7 @@ static int uniwill_resume_keyboard(struct uniwill_data *data) static int uniwill_resume_battery(struct uniwill_data *data) { - if (!(supported_features & UNIWILL_FEATURE_BATTERY)) + if (!uniwill_device_supports(data, UNIWILL_FEATURE_BATTERY)) return 0; return regmap_update_bits(data->regmap, EC_ADDR_CHARGE_CTRL, CHARGE_CTRL_MASK,@@ -1496,6 +1528,25 @@ static struct platform_driver uniwill_driver = { .shutdown = uniwill_shutdown, }; +struct uniwill_device_descriptor lapac71h_descriptor __initdata = { + .features = UNIWILL_FEATURE_FN_LOCK_TOGGLE | + UNIWILL_FEATURE_SUPER_KEY_TOGGLE | + UNIWILL_FEATURE_TOUCHPAD_TOGGLE | + UNIWILL_FEATURE_BATTERY | + UNIWILL_FEATURE_HWMON +}; + +struct uniwill_device_descriptor lapkc71f_descriptor__initdata = { + .features = UNIWILL_FEATURE_FN_LOCK_TOGGLE | + UNIWILL_FEATURE_SUPER_KEY_TOGGLE | + UNIWILL_FEATURE_TOUCHPAD_TOGGLE |
Quoted 8 lines
drivers/platform/x86/uniwill/uniwill-acpi.c static struct platform_driver uniwill_driver = { · line 1548
Quoted 6 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +6
-0+ UNIWILL_FEATURE_LIGHTBAR | + UNIWILL_FEATURE_BATTERY | + UNIWILL_FEATURE_HWMON +}; + +struct uniwill_device_descriptor void_descriptor__initdata = {};
void_descriptor->empty_descriptor.
ack
Quoted 508 lines
With the above issues being fixed:
Reviewed-by Armin Wolf <[email protected]>Quoted 503 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +2
-0+ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { { .ident = "XMG FUSION 15",@@ -1503,6 +1554,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "LAPQC71A"), }, + .driver_data = &void_descriptor, }, {.ident = "XMG FUSION 15",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1510,6 +1562,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "LAPQC71B"), }, + .driver_data = &void_descriptor, }, {.ident = "Intel NUC x15",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-5@@ -1517,11 +1570,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel(R) Client Systems"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LAPAC71H"), }, - .driver_data = (void *)(UNIWILL_FEATURE_FN_LOCK_TOGGLE | - UNIWILL_FEATURE_SUPER_KEY_TOGGLE | - UNIWILL_FEATURE_TOUCHPAD_TOGGLE | - UNIWILL_FEATURE_BATTERY | - UNIWILL_FEATURE_HWMON), + .driver_data = &lapac71h_descriptor, }, {.ident = "Intel NUC x15",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-6@@ -1529,12 +1578,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel(R) Client Systems"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LAPKC71F"), }, - .driver_data = (void *)(UNIWILL_FEATURE_FN_LOCK_TOGGLE | - UNIWILL_FEATURE_SUPER_KEY_TOGGLE | - UNIWILL_FEATURE_TOUCHPAD_TOGGLE | - UNIWILL_FEATURE_LIGHTBAR | - UNIWILL_FEATURE_BATTERY | - UNIWILL_FEATURE_HWMON), + .driver_data = &lapkc71f_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14 Gen6 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1542,6 +1586,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTxX1"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14 Gen6 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1549,6 +1594,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1556,6 +1602,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1563,6 +1610,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1570,6 +1618,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1577,6 +1626,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1584,6 +1634,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1591,6 +1642,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GXxHRXx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/15 Gen9 Intel/Commodore Omnia-Book 15 Gen9",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1598,6 +1650,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GXxMRXx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/15 Gen10 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1605,6 +1658,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxHP4NAx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/15 Gen10 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1612,6 +1666,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 15 Gen10 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1619,6 +1674,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "XxAR4NAx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Max 15 Gen10 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1626,6 +1682,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X5KK45xS_X5SP45xS"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Max 16 Gen10 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1633,6 +1690,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6HP45xU"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Max 16 Gen10 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1640,6 +1698,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6KK45xU_X6SP45xU"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Max 15 Gen10 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1647,6 +1706,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X5AR45xS"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO InfinityBook Max 16 Gen10 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1654,6 +1714,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR55xU"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 15 Gen1 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1661,6 +1722,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501A1650TI"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 15 Gen1 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1668,6 +1730,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501A2060"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 17 Gen1 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1675,6 +1738,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701A1650TI"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 17 Gen1 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1682,6 +1746,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701A2060"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 15 Gen1 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1689,6 +1754,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501I1650TI"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 15 Gen1 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1696,6 +1762,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1501I2060"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 17 Gen1 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1703,6 +1770,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701I1650TI"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 17 Gen1 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1710,6 +1778,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "POLARIS1701I2060"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Trinity 15 Intel Gen1",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1717,6 +1786,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "TRINITY1501I"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Trinity 17 Intel Gen1",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1724,6 +1794,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "TRINITY1701I"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen2 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1731,6 +1802,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen2 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1738,6 +1810,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1745,6 +1818,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1752,6 +1826,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1759,6 +1834,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 15 Gen4 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1766,6 +1842,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1773,6 +1850,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1780,6 +1858,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1787,6 +1866,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1794,6 +1874,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1801,6 +1882,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1808,6 +1890,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1815,6 +1898,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1822,6 +1906,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1829,6 +1914,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1836,6 +1922,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1843,6 +1930,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Pulse 14 Gen1 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1850,6 +1938,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PULSE1401"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Pulse 15 Gen1 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1857,6 +1946,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PULSE1501"), }, + .driver_data = &void_descriptor, }, {.ident = "TUXEDO Pulse 15 Gen2 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1864,6 +1954,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PF5LUXG"), }, + .driver_data = &void_descriptor, }, { }};
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -1871,6 +1962,7 @@ MODULE_DEVICE_TABLE(dmi, uniwill_dmi_table); static int __init uniwill_init(void) { + const struct uniwill_device_descriptor *descriptor; const struct dmi_system_id *id; int ret; @@ -1880,10 +1972,22 @@ static int __init uniwill_init(void) return -ENODEV;/* Assume that the device supports all features */ -
supported_features=UINT_MAX;
+ device_descriptor.features =UINT_MAX;pr_warn("Loading on a potentially unsupported device\n"); } else {
-supported_features= (uintptr_t)id->driver_data;
+ /*
+ * Some devices might support additional features depending on + * the BIOS version/date, so we call this callback to let them + * modify their device descriptor accordingly.
+ */
+ if (id->callback) {
+ ret =id->callback(id);
+ if (ret < 0)
+ return ret;
+ }
+
+ descriptor =id->driver_data;
+device_descriptor= *descriptor;
}
ret =platform_driver_register(&uniwill_driver);
RFC PATCH 2/2 platform/x86/uniwill: Implement cTGP setting
In reply to Werner SembachUniwill offers user setable cTGP for their EC on devices using NVIDIA 3000 Series and newer GPUs. This patch implements this setting as a sysfs attribute.
For one device, the TUXEDO InfinityBook Gen7, the variant with and without NVIDIA GPU can't be differentiated using only the DMI strings, so the new probe callback needs to be used to test a bit from the EC memory.
--- drivers/platform/x86/uniwill/uniwill-acpi.c | 157 ++++++++++++++++---- 1 file changed, 132 insertions(+), 25 deletions(-)
drivers/platform/x86/uniwill/uniwill-acpi.c +132 -25
@@ -88,6 +88,9 @@#define EC_ADDR_GPU_TEMP 0x044F +#define EC_ADDR_SYSTEM_ID 0x0456 +#define HAS_GPU BIT(7) +#define EC_ADDR_MAIN_FAN_RPM_1 0x0464#define EC_ADDR_MAIN_FAN_RPM_2 0x0465
@@ -122,11 +125,11 @@#define CTGP_DB_DB_ENABLE BIT(1)#define CTGP_DB_CTGP_ENABLE BIT(2) -#define EC_ADDR_CTGP_OFFSET 0x0744 +#define EC_ADDR_CTGP_DB_CTGP_OFFSET 0x0744 -#define EC_ADDR_TPP_OFFSET 0x0745 +#define EC_ADDR_CTGP_DB_TPP_OFFSET 0x0745 -#define EC_ADDR_MAX_TGP 0x0746 +#define EC_ADDR_CTGP_DB_DB_OFFSET 0x0746#define EC_ADDR_LIGHTBAR_AC_CTRL 0x0748#define LIGHTBAR_APP_EXISTS BIT(0)
@@ -317,6 +320,7 @@#define UNIWILL_FEATURE_LIGHTBAR BIT(3)#define UNIWILL_FEATURE_BATTERY BIT(4)#define UNIWILL_FEATURE_HWMON BIT(5) +#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL BIT(6)struct uniwill_data {struct device *dev;
@@ -514,6 +518,10 @@ static bool uniwill_writeable_reg(struct device *dev, unsigned int reg)case EC_ADDR_LIGHTBAR_BAT_RED :case EC_ADDR_LIGHTBAR_BAT_GREEN :case EC_ADDR_LIGHTBAR_BAT_BLUE : +case EC_ADDR_CTGP_DB_CTRL : +case EC_ADDR_CTGP_DB_CTGP_OFFSET : +case EC_ADDR_CTGP_DB_TPP_OFFSET : +case EC_ADDR_CTGP_DB_DB_OFFSET :return true;default :return false;
@@ -547,6 +555,10 @@ static bool uniwill_readable_reg(struct device *dev, unsigned int reg)case EC_ADDR_LIGHTBAR_BAT_RED :case EC_ADDR_LIGHTBAR_BAT_GREEN :case EC_ADDR_LIGHTBAR_BAT_BLUE : +case EC_ADDR_CTGP_DB_CTRL : +case EC_ADDR_CTGP_DB_CTGP_OFFSET : +case EC_ADDR_CTGP_DB_TPP_OFFSET : +case EC_ADDR_CTGP_DB_DB_OFFSET :return true;default :return false;
@@ -802,6 +814,68 @@ static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attristatic DEVICE_ATTR_RW (breathing_in_suspend); +static ssize_t ctgp_offset_store (struct device *dev,struct device_attribute *attr, +const char *buf,size_t count) +{ +struct uniwill_data *data =dev_get_drvdata (dev); +unsigned int value; +int ret; + + ret =kstrtouint (buf,0 , &value); +if (ret <0 ) +return ret; + + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_CTGP_OFFSET , value); +if (ret <0 ) +return ret; + +return count; +} + +static ssize_t ctgp_offset_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct uniwill_data *data =dev_get_drvdata (dev); +unsigned int value; +int ret; + + ret =regmap_read (data->regmap,EC_ADDR_CTGP_DB_CTGP_OFFSET , &value); +if (ret <0 ) +return ret; + +return sysfs_emit (buf,"%u\n" , value); +} + +DEVICE_ATTR_RW (ctgp_offset); + +static int uniwill_nvidia_ctgp_init (struct uniwill_data *data) +{ +int ret; + +if (!uniwill_device_supports (data,UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL )) +return 0 ; + + ret =regmap_update_bits (data->regmap,EC_ADDR_CTGP_DB_CTRL , +CTGP_DB_GENERAL_ENABLE |CTGP_DB_DB_ENABLE |CTGP_DB_CTGP_ENABLE , +CTGP_DB_GENERAL_ENABLE |CTGP_DB_DB_ENABLE |CTGP_DB_CTGP_ENABLE ); +if (ret <0 ) +return ret; + + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_CTGP_OFFSET ,0 ); +if (ret <0 ) +return ret; + + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_TPP_OFFSET ,255 ); +if (ret <0 ) +return ret; + + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_DB_OFFSET ,25 ); +if (ret <0 ) +return ret; + +return 0 ; +} +static struct attribute *uniwill_attrs[] = {/* Keyboard-related */ &dev_attr_fn_lock_toggle_enable.attr,
@@ -810,6 +884,8 @@ static struct attribute *uniwill_attrs[] = {/* Lightbar-related */ &dev_attr_rainbow_animation.attr, &dev_attr_breathing_in_suspend.attr, +/* Power-management-related */ + &dev_attr_ctgp_offset.attr, NULL };
@@ -839,6 +915,11 @@ static umode_t uniwill_attr_is_visible(struct kobject *kobj, struct attribute *areturn attr->mode; } +if (attr == &dev_attr_ctgp_offset.attr) { +if (uniwill_device_supports (data,UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL )) +return attr->mode; + } +return 0 ; }
@@ -1405,6 +1486,10 @@ static int uniwill_probe(struct platform_device *pdev)if (ret <0 )return ret; + ret =uniwill_nvidia_ctgp_init (data); +if (ret <0 ) +return ret; +return uniwill_input_init (data); }
@@ -1545,6 +1630,28 @@ struct uniwill_device_descriptor lapkc71f_descriptor __initdata = {UNIWILL_FEATURE_HWMON }; +static int phxarx1_phxaqf1_probe (struct uniwill_data *data) +{ +unsigned int value; +int ret; + + ret =regmap_read (data->regmap,EC_ADDR_SYSTEM_ID , &value); +if (ret <0 ) +return ret; +if (value &HAS_GPU ) + data->features |=UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL ; + +return 0 ; +}; + +struct uniwill_device_descriptor phxarx1_phxaqf1_descriptor__initdata = { + .probe = phxarx1_phxaqf1_probe +}; + +struct uniwill_device_descriptor tux_featureset_1_descriptor__initdata = { + .features =UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL +}; +struct uniwill_device_descriptor void_descriptor__initdata = {};static const struct dmi_system_id uniwill_dmi_table[]__initconst = {
@@ -1594,7 +1701,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",
@@ -1602,7 +1709,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",
@@ -1610,7 +1717,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
@@ -1626,7 +1733,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",
@@ -1634,7 +1741,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",
@@ -1802,7 +1909,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen2 Intel",
@@ -1810,7 +1917,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",
@@ -1818,7 +1925,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",
@@ -1826,7 +1933,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",
@@ -1834,7 +1941,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 15 Gen4 Intel",
@@ -1842,7 +1949,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen5 AMD",
@@ -1850,7 +1957,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen5 AMD",
@@ -1858,7 +1965,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",
@@ -1866,7 +1973,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",
@@ -1874,7 +1981,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",
@@ -1882,7 +1989,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
@@ -1890,7 +1997,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
@@ -1898,7 +2005,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",
@@ -1906,7 +2013,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 AMD",
@@ -1914,7 +2021,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",
@@ -1922,7 +2029,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",
@@ -1930,7 +2037,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Pulse 14 Gen1 AMD",
Signature · 1 line
2.43.0
Armin Wolf
maintainerRe: [RFC PATCH 2/2] platform/x86/uniwill: Implement cTGP setting
Am 25.11.25 um 14:49 schrieb Werner Sembach:
Quoted 100 lines
Uniwill offers user setable cTGP for their EC on devices using NVIDIA 3000 Series and newer GPUs. This patch implements this setting as a sysfs attribute.
For one device, the TUXEDO InfinityBook Gen7, the variant with and without NVIDIA GPU can't be differentiated using only the DMI strings, so the new probe callback needs to be used to test a bit from the EC memory.
Signed-off-by Werner Sembach <[email protected]>--- drivers/platform/x86/uniwill/uniwill-acpi.c | 157 ++++++++++++++++---- 1 file changed, 132 insertions(+), 25 deletions(-)drivers/platform/x86/uniwill/uniwill-acpi.c +25
-3@@ -88,6 +88,9 @@#define EC_ADDR_GPU_TEMP 0x044F +#define EC_ADDR_SYSTEM_ID 0x0456 +#define HAS_GPU BIT(7) +#define EC_ADDR_MAIN_FAN_RPM_1 0x0464#define EC_ADDR_MAIN_FAN_RPM_2 0x0465@@ -122,11 +125,11 @@#define CTGP_DB_DB_ENABLE BIT(1)#define CTGP_DB_CTGP_ENABLE BIT(2) -#define EC_ADDR_CTGP_OFFSET 0x0744 +#define EC_ADDR_CTGP_DB_CTGP_OFFSET 0x0744 -#define EC_ADDR_TPP_OFFSET 0x0745 +#define EC_ADDR_CTGP_DB_TPP_OFFSET 0x0745 -#define EC_ADDR_MAX_TGP 0x0746 +#define EC_ADDR_CTGP_DB_DB_OFFSET 0x0746#define EC_ADDR_LIGHTBAR_AC_CTRL 0x0748#define LIGHTBAR_APP_EXISTS BIT(0)@@ -317,6 +320,7 @@#define UNIWILL_FEATURE_LIGHTBAR BIT(3)#define UNIWILL_FEATURE_BATTERY BIT(4)#define UNIWILL_FEATURE_HWMON BIT(5) +#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL BIT(6)struct uniwill_data {struct device *dev;@@ -514,6 +518,10 @@ static bool uniwill_writeable_reg(struct device *dev, unsigned int reg)case EC_ADDR_LIGHTBAR_BAT_RED :case EC_ADDR_LIGHTBAR_BAT_GREEN :case EC_ADDR_LIGHTBAR_BAT_BLUE : +case EC_ADDR_CTGP_DB_CTRL : +case EC_ADDR_CTGP_DB_CTGP_OFFSET : +case EC_ADDR_CTGP_DB_TPP_OFFSET : +case EC_ADDR_CTGP_DB_DB_OFFSET :return true;default :return false;@@ -547,6 +555,10 @@ static bool uniwill_readable_reg(struct device *dev, unsigned int reg)case EC_ADDR_LIGHTBAR_BAT_RED :case EC_ADDR_LIGHTBAR_BAT_GREEN :case EC_ADDR_LIGHTBAR_BAT_BLUE : +case EC_ADDR_CTGP_DB_CTRL : +case EC_ADDR_CTGP_DB_CTGP_OFFSET : +case EC_ADDR_CTGP_DB_TPP_OFFSET : +case EC_ADDR_CTGP_DB_DB_OFFSET :return true;default :return false;@@ -802,6 +814,68 @@ static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attristatic DEVICE_ATTR_RW (breathing_in_suspend); +static ssize_t ctgp_offset_store (struct device *dev,struct device_attribute *attr, +const char *buf,size_t count) +{ +struct uniwill_data *data =dev_get_drvdata (dev); +unsigned int value; +int ret; + + ret =kstrtouint (buf,0 , &value); +if (ret <0 ) +return ret;Please check for input values larger than 255 and return
-EINVALin such a case.drivers/platform/x86/uniwill/uniwill-acpi.c +13
-0+ + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_CTGP_OFFSET , value); +if (ret <0 ) +return ret; + +return count; +} + +static ssize_t ctgp_offset_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct uniwill_data *data =dev_get_drvdata (dev); +unsigned int value;
drivers/platform/x86/uniwill/uniwill-acpi.c static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attri · line 849
Quoted 10 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +10
-0+int ret; + + ret =regmap_read (data->regmap,EC_ADDR_CTGP_DB_CTGP_OFFSET , &value); +if (ret <0 ) +return ret; + +return sysfs_emit (buf,"%u\n" , value); +} + +DEVICE_ATTR_RW (ctgp_offset);
Please mark this device attribute as static.
drivers/platform/x86/uniwill/uniwill-acpi.c static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attri · line 860
Quoted 11 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +11
-0+ +static int uniwill_nvidia_ctgp_init (struct uniwill_data *data) +{ +int ret; + +if (!uniwill_device_supports (data,UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL )) +return 0 ; + + ret =regmap_update_bits (data->regmap,EC_ADDR_CTGP_DB_CTRL , +CTGP_DB_GENERAL_ENABLE |CTGP_DB_DB_ENABLE |CTGP_DB_CTGP_ENABLE , +CTGP_DB_GENERAL_ENABLE |CTGP_DB_DB_ENABLE |CTGP_DB_CTGP_ENABLE );
Please initialize the power limits before enabling them. Also, maybe disabling those power limits during suspend and re-enabling them during resume would be a good idea? This way we can avoid overheating the device should the fan stop too early.
Quoted 55 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +29
-0+if (ret <0 ) +return ret; + + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_CTGP_OFFSET ,0 ); +if (ret <0 ) +return ret; + + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_TPP_OFFSET ,255 ); +if (ret <0 ) +return ret; + + ret =regmap_write (data->regmap,EC_ADDR_CTGP_DB_DB_OFFSET ,25 ); +if (ret <0 ) +return ret; + +return 0 ; +} +static struct attribute *uniwill_attrs[] = {/* Keyboard-related */ &dev_attr_fn_lock_toggle_enable.attr,@@ -810,6 +884,8 @@ static struct attribute *uniwill_attrs[] = {/* Lightbar-related */ &dev_attr_rainbow_animation.attr, &dev_attr_breathing_in_suspend.attr, +/* Power-management-related */ + &dev_attr_ctgp_offset.attr, NULL };@@ -839,6 +915,11 @@ static umode_t uniwill_attr_is_visible(struct kobject *kobj, struct attribute *areturn attr->mode; } +if (attr == &dev_attr_ctgp_offset.attr) { +if (uniwill_device_supports (data,UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL )) +return attr->mode; + } +return 0 ; }@@ -1405,6 +1486,10 @@ static int uniwill_probe(struct platform_device *pdev)if (ret <0 )return ret; + ret =uniwill_nvidia_ctgp_init (data); +if (ret <0 ) +return ret; +return uniwill_input_init (data); }@@ -1545,6 +1630,28 @@ struct uniwill_device_descriptor lapkc71f_descriptor __initdata = {UNIWILL_FEATURE_HWMON
drivers/platform/x86/uniwill/uniwill-acpi.c struct uniwill_device_descriptor lapkc71f_descriptor __initdata = { · line 1640
Quoted 10 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +8
-0}; +static int phxarx1_phxaqf1_probe (struct uniwill_data *data) +{ +unsigned int value; +int ret; + + ret =regmap_read (data->regmap,EC_ADDR_SYSTEM_ID , &value); +if (ret <0 ) +return ret;
Please add an empty line here.
Quoted 5 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+if (value &HAS_GPU ) + data->features |=UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL ; + +return 0 ; +};
drivers/platform/x86/uniwill/uniwill-acpi.c struct uniwill_device_descriptor lapkc71f_descriptor __initdata = { · line 1655
Quoted 10 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +9
-0+ +struct uniwill_device_descriptor phxarx1_phxaqf1_descriptor__initdata = { + .probe = phxarx1_phxaqf1_probe +}; + +struct uniwill_device_descriptor tux_featureset_1_descriptor__initdata = { + .features =UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL +}; +struct uniwill_device_descriptor void_descriptor__initdata = {};
I just noticed that all device descriptors are not marked as static. Please fix this.
Other than that, the patch looks very promising.
Thanks,
Armin Wolf
Quoted 200 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +22
-22static const struct dmi_system_id uniwill_dmi_table[]__initconst = {@@ -1594,7 +1701,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PHxTQx1" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",@@ -1602,7 +1709,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PHxARX1_PHxAQF1" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",@@ -1610,7 +1717,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PH6AG01_PH6AQ71_PH6AQI1" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",@@ -1626,7 +1733,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PH4PG31" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",@@ -1634,7 +1741,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"PH6PG01_PH6PG71" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",@@ -1802,7 +1909,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxMGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen2 Intel",@@ -1810,7 +1917,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxNGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",@@ -1818,7 +1925,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxZGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",@@ -1826,7 +1933,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxTGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",@@ -1834,7 +1941,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxRGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 15 Gen4 Intel",@@ -1842,7 +1949,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxAGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Polaris 15/17 Gen5 AMD",@@ -1850,7 +1957,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxXGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen5 AMD",@@ -1858,7 +1965,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM6XGxX" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",@@ -1866,7 +1973,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxPXxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",@@ -1874,7 +1981,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GMxHGxx" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",@@ -1882,7 +1989,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM5IXxA" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",@@ -1890,7 +1997,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM6IXxB_MB1" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",@@ -1898,7 +2005,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM6IXxB_MB2" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",@@ -1906,7 +2013,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"GM7IXxN" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 AMD",@@ -1914,7 +2021,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6FR5xxY" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",@@ -1922,7 +2029,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6AR5xxY" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Stellaris 16 Gen7 Intel",@@ -1930,7 +2037,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {DMI_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ),DMI_EXACT_MATCH (DMI_BOARD_NAME ,"X6AR5xxY_mLED" ), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, { .ident = "TUXEDO Pulse 14 Gen1 AMD",
Re: [RFC PATCH 2/2] platform/x86/uniwill: Implement cTGP setting
Am 25.11.25 um 21:31 schrieb Armin Wolf:
Quoted 100 lines
Am 25.11.25 um 14:49 schrieb Werner Sembach:
Quoted 98 lines
Uniwill offers user setable cTGP for their EC on devices using NVIDIA 3000 Series and newer GPUs. This patch implements this setting as a sysfs attribute.
For one device, the TUXEDO InfinityBook Gen7, the variant with and without NVIDIA GPU can't be differentiated using only the DMI strings, so the new probe callback needs to be used to test a bit from the EC memory.
Signed-off-by Werner Sembach <[email protected]>---
drivers/platform/x86/uniwill/uniwill-acpi.c| 157 ++++++++++++++++----1 file changed, 132 insertions(+), 25 deletions(-)drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -88,6 +88,9 @@ #define EC_ADDR_GPU_TEMP 0x044F+#define EC_ADDR_SYSTEM_ID
0x0456drivers/platform/x86/uniwill/uniwill-acpi.c +2
-0+#define HAS_GPU BIT(7) +#define EC_ADDR_MAIN_FAN_RPM_1
0x0464
#define EC_ADDR_MAIN_FAN_RPM_20x0465drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -122,11 +125,11 @@ #define CTGP_DB_DB_ENABLE BIT(1) #define CTGP_DB_CTGP_ENABLE BIT(2)-#define EC_ADDR_CTGP_OFFSET
0x0744
+#define EC_ADDR_CTGP_DB_CTGP_OFFSET0x0744
-#define EC_ADDR_TPP_OFFSET0x0745
+#define EC_ADDR_CTGP_DB_TPP_OFFSET0x0745
-#define EC_ADDR_MAX_TGP0x0746
+#define EC_ADDR_CTGP_DB_DB_OFFSET0x0746
#define EC_ADDR_LIGHTBAR_AC_CTRL0x0748
#define LIGHTBAR_APP_EXISTS BIT(0)drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -317,6 +320,7 @@ #define UNIWILL_FEATURE_LIGHTBAR BIT(3) #define UNIWILL_FEATURE_BATTERY BIT(4) #define UNIWILL_FEATURE_HWMON BIT(5) +#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL BIT(6) struct uniwill_data { struct device *dev;@@ -514,6 +518,10 @@ static bool uniwill_writeable_reg(struct device *dev, unsigned int reg)case
EC_ADDR_LIGHTBAR_BAT_RED:
caseEC_ADDR_LIGHTBAR_BAT_GREEN:
caseEC_ADDR_LIGHTBAR_BAT_BLUE:
+ caseEC_ADDR_CTGP_DB_CTRL:
+ caseEC_ADDR_CTGP_DB_CTGP_OFFSET:
+ caseEC_ADDR_CTGP_DB_TPP_OFFSET:
+ caseEC_ADDR_CTGP_DB_DB_OFFSET:
return true;
default:
return false;drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -547,6 +555,10 @@ static bool uniwill_readable_reg(struct device *dev, unsigned int reg)case
EC_ADDR_LIGHTBAR_BAT_RED:
caseEC_ADDR_LIGHTBAR_BAT_GREEN:
caseEC_ADDR_LIGHTBAR_BAT_BLUE:
+ caseEC_ADDR_CTGP_DB_CTRL:
+ caseEC_ADDR_CTGP_DB_CTGP_OFFSET:
+ caseEC_ADDR_CTGP_DB_TPP_OFFSET:
+ caseEC_ADDR_CTGP_DB_DB_OFFSET:
return true;
default:
return false;drivers/platform/x86/uniwill/uniwill-acpi.c +9
-0@@ -802,6 +814,68 @@ static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attri static DEVICE_ATTR_RW(breathing_in_suspend); +static ssize_t ctgp_offset_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + struct uniwill_data *data = dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret = kstrtouint(buf, 0, &value); + if (ret < 0) + return ret;Please check for input values larger than 255 and return
-EINVALin such a case.drivers/platform/x86/uniwill/uniwill-acpi.c +9
-0+ + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, value); + if (ret < 0) + return ret; + + return count; +} + +static ssize_t ctgp_offset_show(struct device *dev, struct device_attribute*attr,
+ char *buf)drivers/platform/x86/uniwill/uniwill-acpi.c +7
-0+{ + struct uniwill_data *data = dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret = regmap_read(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, &value); + if (ret < 0)
Quoted 8 lines
drivers/platform/x86/uniwill/uniwill-acpi.c static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attri · line 849
Quoted 6 lines
+ return ret;
drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+ + return sysfs_emit(buf, "%u\n", value); +} + +DEVICE_ATTR_RW (ctgp_offset);Please mark this device attribute as static.
ack thanks for spotting
Quoted 16 lines
Quoted 11 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +10
-0+ +static int uniwill_nvidia_ctgp_init (struct uniwill_data *data) +{ + int ret; + + if (!uniwill_device_supports(data, UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL)) + return 0; + + ret = regmap_update_bits(data->regmap, EC_ADDR_CTGP_DB_CTRL, + CTGP_DB_GENERAL_ENABLE | CTGP_DB_DB_ENABLE |Quoted 3 lines
CTGP_DB_CTGP_ENABLE,
+CTGP_DB_GENERAL_ENABLE|CTGP_DB_DB_ENABLE|CTGP_DB_CTGP_ENABLE);Please initialize the power limits before enabling them.
ack, sorry forgot
Quoted 3 lines
Also, maybe disabling those power limits during
suspend and re-enabling them during resume would be a good idea? This way we can avoid overheating the device should the fan stop too early.
Don't think that is necessary as other vendors don't even have the ability to disable db for example.
Also even with ctgp and db disabled the minimum TGP is still reachable and that already is 125W on some devices.
Quoted 54 lines
Quoted 54 lines
+ if (ret < 0)
+ return ret;drivers/platform/x86/uniwill/uniwill-acpi.c +16
-0+ + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, 0); + if (ret < 0) + return ret; + + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_TPP_OFFSET, 255); + if (ret < 0) + return ret; + + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_DB_OFFSET, 25); + if (ret < 0) + return ret; + + return 0; +} +static struct attribute *uniwill_attrs[] = {
/* Keyboard-related */
&dev_attr_fn_lock_toggle_enable.attr,drivers/platform/x86/uniwill/uniwill-acpi.c +2
-0@@ -810,6 +884,8 @@ static struct attribute *uniwill_attrs[] = { /* Lightbar-related */ &dev_attr_rainbow_animation.attr, &dev_attr_breathing_in_suspend.attr, + /* Power-management-related */ + &dev_attr_ctgp_offset.attr,NULL
};
@@ -839,6 +915,11 @@ staticumode_tuniwill_attr_is_visible(struct kobject *kobj, struct attribute *a returnattr->mode;
}
+ if (attr == &dev_attr_ctgp_offset.attr) {
+ if (uniwill_device_supports(data, UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
+ returnattr->mode;
+ }
+
return 0;
}
@@ -1405,6 +1486,10 @@ static intuniwill_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
+ ret =uniwill_nvidia_ctgp_init(data);
+ if (ret < 0)
+ return ret;
+
returnuniwill_input_init(data);
}
@@ -1545,6 +1630,28 @@ structuniwill_device_descriptorlapkc71f_descriptor__initdata= {UNIWILL_FEATURE_HWMON
};
+static intphxarx1_phxaqf1_probe(struct uniwill_data *data)
+{
Quoted 8 lines
Quoted 6 lines
+ unsigned int value;
+ int ret;
+
+ ret =regmap_read(data->regmap, EC_ADDR_SYSTEM_ID, &value); + if (ret < 0)
+ return ret;Please add an empty line here.
kk
Quoted 10 lines
Quoted 10 lines
+ if (value &
HAS_GPU)
+data->features|=UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL;drivers/platform/x86/uniwill/uniwill-acpi.c +7
-0+ + return 0; +}; + +struct uniwill_device_descriptor phxarx1_phxaqf1_descriptor__initdata = { + .probe = phxarx1_phxaqf1_probe +};
Quoted 8 lines
Quoted 6 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+ +struct uniwill_device_descriptor tux_featureset_1_descriptor__initdata = { + .features = UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL +}; +struct
uniwill_device_descriptorvoid_descriptor__initdata= {};I just noticed that all device descriptors are not marked as static. Please fix this.
ack, sorry overlooked that
Quick feedback if I should include the suspend disable anyway and I will wait a little bit to give Ilpo a chance to respond, but other than that: non RFC of this patchset incoming
Best regards,
Werner
Quoted 227 lines
Other than that, the patch looks very promising.
Thanks,
Armin WolfQuoted 221 lines
static const struct
dmi_system_iduniwill_dmi_table[]__initconst= {drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1594,7 +1701,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1602,7 +1709,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1610,7 +1717,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1626,7 +1733,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1634,7 +1741,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1802,7 +1909,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen2 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1810,7 +1917,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1818,7 +1925,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1826,7 +1933,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1834,7 +1941,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 15 Gen4 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1842,7 +1949,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1850,7 +1957,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1858,7 +1965,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1866,7 +1973,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1874,7 +1981,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1882,7 +1989,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1890,7 +1997,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1898,7 +2005,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1906,7 +2013,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1914,7 +2021,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1922,7 +2029,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1930,7 +2037,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Pulse 14 Gen1 AMD",
Armin Wolf
maintainerRe: [RFC PATCH 2/2] platform/x86/uniwill: Implement cTGP setting
Am 26.11.25 um 13:23 schrieb Werner Sembach:
Quoted 131 lines
Am 25.11.25 um 21:31 schrieb Armin Wolf:
Quoted 103 lines
Am 25.11.25 um 14:49 schrieb Werner Sembach:
Quoted 101 lines
Uniwill offers user setable cTGP for their EC on devices using NVIDIA 3000 Series and newer GPUs. This patch implements this setting as a sysfs attribute.
For one device, the TUXEDO InfinityBook Gen7, the variant with and without NVIDIA GPU can't be differentiated using only the DMI strings, so the new probe callback needs to be used to test a bit from the EC memory.
Signed-off-by Werner Sembach <[email protected]>---
drivers/platform/x86/uniwill/uniwill-acpi.c| 157
++++++++++++++++----1 file changed, 132 insertions(+), 25 deletions(-)drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -88,6 +88,9 @@ #define EC_ADDR_GPU_TEMP 0x044F+#define EC_ADDR_SYSTEM_ID
0x0456drivers/platform/x86/uniwill/uniwill-acpi.c +2
-0+#define HAS_GPU BIT(7) +#define EC_ADDR_MAIN_FAN_RPM_1
0x0464
#define EC_ADDR_MAIN_FAN_RPM_20x0465drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -122,11 +125,11 @@ #define CTGP_DB_DB_ENABLE BIT(1) #define CTGP_DB_CTGP_ENABLE BIT(2)-#define EC_ADDR_CTGP_OFFSET
0x0744
+#define EC_ADDR_CTGP_DB_CTGP_OFFSET0x0744
-#define EC_ADDR_TPP_OFFSET0x0745
+#define EC_ADDR_CTGP_DB_TPP_OFFSET0x0745
-#define EC_ADDR_MAX_TGP0x0746
+#define EC_ADDR_CTGP_DB_DB_OFFSET0x0746
#define EC_ADDR_LIGHTBAR_AC_CTRL0x0748
#define LIGHTBAR_APP_EXISTS BIT(0)drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -317,6 +320,7 @@ #define UNIWILL_FEATURE_LIGHTBAR BIT(3) #define UNIWILL_FEATURE_BATTERY BIT(4) #define UNIWILL_FEATURE_HWMON BIT(5) +#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL BIT(6) struct uniwill_data { struct device *dev;@@ -514,6 +518,10 @@ static bool uniwill_writeable_reg(struct device *dev, unsigned int reg)case
EC_ADDR_LIGHTBAR_BAT_RED:
caseEC_ADDR_LIGHTBAR_BAT_GREEN:
caseEC_ADDR_LIGHTBAR_BAT_BLUE:
+ caseEC_ADDR_CTGP_DB_CTRL:
+ caseEC_ADDR_CTGP_DB_CTGP_OFFSET:
+ caseEC_ADDR_CTGP_DB_TPP_OFFSET:
+ caseEC_ADDR_CTGP_DB_DB_OFFSET:
return true;
default:
return false;drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -547,6 +555,10 @@ static bool uniwill_readable_reg(struct device *dev, unsigned int reg)case
EC_ADDR_LIGHTBAR_BAT_RED:
caseEC_ADDR_LIGHTBAR_BAT_GREEN:
caseEC_ADDR_LIGHTBAR_BAT_BLUE:
+ caseEC_ADDR_CTGP_DB_CTRL:
+ caseEC_ADDR_CTGP_DB_CTGP_OFFSET:
+ caseEC_ADDR_CTGP_DB_TPP_OFFSET:
+ caseEC_ADDR_CTGP_DB_DB_OFFSET:
return true;
default:
return false;drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -802,6 +814,68 @@ static ssize_t breathing_in_suspend_show(structdevice *dev, struct
device_attri
staticDEVICE_ATTR_RW(breathing_in_suspend);
+staticssize_tctgp_offset_store(struct device *dev, structdevice_attribute*attr, + const char *buf,size_tcount)drivers/platform/x86/uniwill/uniwill-acpi.c +8
-0+{ + struct uniwill_data *data = dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret = kstrtouint(buf, 0, &value); + if (ret < 0) + return ret;Please check for input values larger than 255 and return
-EINVALin such a case. +
+ ret =regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, value);
+ if (ret < 0)
+ return ret;drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+ + return count; +} + +static ssize_t ctgp_offset_show(struct device *dev, struct
device_attribute*attr,
+ char *buf)drivers/platform/x86/uniwill/uniwill-acpi.c +6
-0+{ + struct uniwill_data *data = dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret = regmap_read(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET,&value);
+ if (ret < 0)Quoted 8 lines
drivers/platform/x86/uniwill/uniwill-acpi.c static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attri · line 849
Quoted 6 lines
+ return ret;
drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+ + return sysfs_emit(buf, "%u\n", value); +} + +DEVICE_ATTR_RW (ctgp_offset);Please mark this device attribute as static.
ack thanks for spotting
Quoted 17 lines
Quoted 7 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +6
-0+ +static int uniwill_nvidia_ctgp_init(struct uniwill_data *data) +{ + int ret; + + if (!uniwill_device_supports(data,Quoted 8 lines
UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
+ return 0;
+
+ ret = regmap_update_bits(data->regmap,EC_ADDR_CTGP_DB_CTRL, +CTGP_DB_GENERAL_ENABLE|CTGP_DB_DB_ENABLE|CTGP_DB_CTGP_ENABLE,
+CTGP_DB_GENERAL_ENABLE|CTGP_DB_DB_ENABLE|CTGP_DB_CTGP_ENABLE);Please initialize the power limits before enabling them.
Quoted 9 lines
ack, sorry forgot
Quoted 3 lines
Also, maybe disabling those power limits during
suspend and re-enabling them during resume would be a good idea? This way we can avoid overheating the device should the fan stop too early.Don't think that is necessary as other vendors don't even have the ability to disable db for example.
Also even with ctgp and db disabled the minimum TGP is still reachable and that already is 125W on some devices.
Disabling cTGP and dynamic boost during suspend is necessary because regmap might restore EC_ADDR_CTGP_DB_CTRL first during resume, and this might cause issues should EC_ADDR_CTGP_DB_CTGP_OFFSET and friends contain garbage data.
I am aware that the OEM software on the Intel Nuc laptop does not disable those settings when suspending, but i just want to make sure that no bad things happen on devices with a badly designed platform firmware.
Thanks,
Armin Wolf
Quoted 320 lines
Quoted 55 lines
Quoted 55 lines
+ if (ret < 0)
+ return ret;drivers/platform/x86/uniwill/uniwill-acpi.c +16
-0+ + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, 0); + if (ret < 0) + return ret; + + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_TPP_OFFSET, 255); + if (ret < 0) + return ret; + + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_DB_OFFSET, 25); + if (ret < 0) + return ret; + + return 0; +} +static struct attribute *uniwill_attrs[] = {
/* Keyboard-related */
&dev_attr_fn_lock_toggle_enable.attr,drivers/platform/x86/uniwill/uniwill-acpi.c +2
-0@@ -810,6 +884,8 @@ static struct attribute *uniwill_attrs[] = { /* Lightbar-related */ &dev_attr_rainbow_animation.attr, &dev_attr_breathing_in_suspend.attr, + /* Power-management-related */ + &dev_attr_ctgp_offset.attr,NULL
};
@@ -839,6 +915,11 @@ staticumode_tuniwill_attr_is_visible(struct kobject *kobj, struct attribute *a returnattr->mode;
}
+ if (attr == &dev_attr_ctgp_offset.attr) {
+ if (uniwill_device_supports(data,UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
+ returnattr->mode;
+ }
+
return 0;
}
@@ -1405,6 +1486,10 @@ static intuniwill_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
+ ret =uniwill_nvidia_ctgp_init(data);
+ if (ret < 0)
+ return ret;
+
returnuniwill_input_init(data);
}
@@ -1545,6 +1630,28 @@ structuniwill_device_descriptorlapkc71f_descriptor__initdata= {UNIWILL_FEATURE_HWMON
};
+static intphxarx1_phxaqf1_probe(struct uniwill_data *data)
+{Quoted 8 lines
Quoted 6 lines
+ unsigned int value;
+ int ret;
+
+ ret =regmap_read(data->regmap, EC_ADDR_SYSTEM_ID, &value); + if (ret < 0)
+ return ret;Please add an empty line here.
kk
Quoted 12 lines
Quoted 12 lines
+ if (value &
HAS_GPU)
+data->features|=UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL;drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+ + return 0; +}; + +struct uniwill_device_descriptor phxarx1_phxaqf1_descriptor
__initdata= {
+ .probe =phxarx1_phxaqf1_probedrivers/platform/x86/uniwill/uniwill-acpi.c +2
-0+}; +Quoted 8 lines
Quoted 6 lines
+struct
uniwill_device_descriptortux_featureset_1_descriptor__initdata= {
+ .features =UNIWILL_FEATURE_NVIDIA_CTGP_CONTROLdrivers/platform/x86/uniwill/uniwill-acpi.c +2
-0+}; +struct
uniwill_device_descriptorvoid_descriptor__initdata= {};I just noticed that all device descriptors are not marked as static. Please fix this.
ack, sorry overlooked that
Quick feedback if I should include the suspend disable anyway and I will wait a little bit to give Ilpo a chance to respond, but other than that: non RFC of this patchset incoming
Best regards,
Werner
Quoted 227 lines
Other than that, the patch looks very promising.
Thanks,
Armin WolfQuoted 221 lines
static const struct
dmi_system_iduniwill_dmi_table[]__initconst= {drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1594,7 +1701,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1602,7 +1709,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1610,7 +1717,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1626,7 +1733,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1634,7 +1741,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1802,7 +1909,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen2 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1810,7 +1917,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1818,7 +1925,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1826,7 +1933,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1834,7 +1941,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 15 Gen4 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1842,7 +1949,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1850,7 +1957,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1858,7 +1965,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1866,7 +1973,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1874,7 +1981,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1882,7 +1989,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1890,7 +1997,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1898,7 +2005,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1906,7 +2013,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1914,7 +2021,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1922,7 +2029,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1930,7 +2037,7 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Pulse 14 Gen1 AMD",
Re: [RFC PATCH 2/2] platform/x86/uniwill: Implement cTGP setting
Am 26.11.25 um 20:33 schrieb Armin Wolf:
Quoted 136 lines
Am 26.11.25 um 13:23 schrieb Werner Sembach:
Quoted 134 lines
Am 25.11.25 um 21:31 schrieb Armin Wolf:
Quoted 100 lines
Am 25.11.25 um 14:49 schrieb Werner Sembach:
Quoted 98 lines
Uniwill offers user setable cTGP for their EC on devices using NVIDIA 3000 Series and newer GPUs. This patch implements this setting as a sysfs attribute.
For one device, the TUXEDO InfinityBook Gen7, the variant with and without NVIDIA GPU can't be differentiated using only the DMI strings, so the new probe callback needs to be used to test a bit from the EC memory.
Signed-off-by Werner Sembach <[email protected]>---
drivers/platform/x86/uniwill/uniwill-acpi.c| 157 ++++++++++++++++----1 file changed, 132 insertions(+), 25 deletions(-)drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -88,6 +88,9 @@ #define EC_ADDR_GPU_TEMP 0x044F+#define EC_ADDR_SYSTEM_ID
0x0456drivers/platform/x86/uniwill/uniwill-acpi.c +2
-0+#define HAS_GPU BIT(7) +#define EC_ADDR_MAIN_FAN_RPM_1
0x0464
#define EC_ADDR_MAIN_FAN_RPM_20x0465drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -122,11 +125,11 @@ #define CTGP_DB_DB_ENABLE BIT(1) #define CTGP_DB_CTGP_ENABLE BIT(2)-#define EC_ADDR_CTGP_OFFSET
0x0744
+#define EC_ADDR_CTGP_DB_CTGP_OFFSET0x0744
-#define EC_ADDR_TPP_OFFSET0x0745
+#define EC_ADDR_CTGP_DB_TPP_OFFSET0x0745
-#define EC_ADDR_MAX_TGP0x0746
+#define EC_ADDR_CTGP_DB_DB_OFFSET0x0746
#define EC_ADDR_LIGHTBAR_AC_CTRL0x0748
#define LIGHTBAR_APP_EXISTS BIT(0)drivers/platform/x86/uniwill/uniwill-acpi.c +1
-0@@ -317,6 +320,7 @@ #define UNIWILL_FEATURE_LIGHTBAR BIT(3) #define UNIWILL_FEATURE_BATTERY BIT(4) #define UNIWILL_FEATURE_HWMON BIT(5) +#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL BIT(6) struct uniwill_data { struct device *dev;@@ -514,6 +518,10 @@ static bool uniwill_writeable_reg(struct device *dev, unsigned int reg)case
EC_ADDR_LIGHTBAR_BAT_RED:
caseEC_ADDR_LIGHTBAR_BAT_GREEN:
caseEC_ADDR_LIGHTBAR_BAT_BLUE:
+ caseEC_ADDR_CTGP_DB_CTRL:
+ caseEC_ADDR_CTGP_DB_CTGP_OFFSET:
+ caseEC_ADDR_CTGP_DB_TPP_OFFSET:
+ caseEC_ADDR_CTGP_DB_DB_OFFSET:
return true;
default:
return false;drivers/platform/x86/uniwill/uniwill-acpi.c +0
-0@@ -547,6 +555,10 @@ static bool uniwill_readable_reg(struct device *dev, unsigned int reg)case
EC_ADDR_LIGHTBAR_BAT_RED:
caseEC_ADDR_LIGHTBAR_BAT_GREEN:
caseEC_ADDR_LIGHTBAR_BAT_BLUE:
+ caseEC_ADDR_CTGP_DB_CTRL:
+ caseEC_ADDR_CTGP_DB_CTGP_OFFSET:
+ caseEC_ADDR_CTGP_DB_TPP_OFFSET:
+ caseEC_ADDR_CTGP_DB_DB_OFFSET:
return true;
default:
return false;drivers/platform/x86/uniwill/uniwill-acpi.c +9
-0@@ -802,6 +814,68 @@ static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attri static DEVICE_ATTR_RW(breathing_in_suspend); +static ssize_t ctgp_offset_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + struct uniwill_data *data = dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret = kstrtouint(buf, 0, &value); + if (ret < 0) + return ret;Please check for input values larger than 255 and return
-EINVALin such a case.drivers/platform/x86/uniwill/uniwill-acpi.c +9
-0+ + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, value); + if (ret < 0) + return ret; + + return count; +} + +static ssize_t ctgp_offset_show(struct device *dev, struct
device_attribute*attr,
+ char *buf)drivers/platform/x86/uniwill/uniwill-acpi.c +7
-0+{ + struct uniwill_data *data = dev_get_drvdata(dev); + unsigned int value; + int ret; + + ret = regmap_read(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, &value); + if (ret < 0)Quoted 8 lines
drivers/platform/x86/uniwill/uniwill-acpi.c static ssize_t breathing_in_suspend_show(struct device *dev, struct device_attri · line 849
Quoted 6 lines
+ return ret;
drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+ + return sysfs_emit(buf, "%u\n", value); +} + +DEVICE_ATTR_RW (ctgp_offset);Please mark this device attribute as static.
ack thanks for spotting
Quoted 16 lines
Quoted 11 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +10
-0+ +static int uniwill_nvidia_ctgp_init (struct uniwill_data *data) +{ + int ret; + + if (!uniwill_device_supports(data, UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL)) + return 0; + + ret = regmap_update_bits(data->regmap, EC_ADDR_CTGP_DB_CTRL, + CTGP_DB_GENERAL_ENABLE | CTGP_DB_DB_ENABLE |Quoted 3 lines
CTGP_DB_CTGP_ENABLE,
+CTGP_DB_GENERAL_ENABLE|CTGP_DB_DB_ENABLE|CTGP_DB_CTGP_ENABLE);Please initialize the power limits before enabling them.
ack, sorry forgot
Quoted 3 lines
Also, maybe disabling those power limits during
suspend and re-enabling them during resume would be a good idea? This way we can avoid overheating the device should the fan stop too early.Don't think that is necessary as other vendors don't even have the ability to disable db for example.
Quoted 7 lines
Quoted 2 lines
Also even with ctgp and db disabled the minimum TGP is still reachable and that already is 125W on some devices.
Disabling cTGP and dynamic boost during suspend is necessary because regmap might restore
EC_ADDR_CTGP_DB_CTRLfirst during resume, and this might cause issues shouldEC_ADDR_CTGP_DB_CTGP_OFFSETand friends contain garbage data.I am aware that the OEM software on the Intel Nuc laptop does not disable those settings when suspending, but i just want to make sure that no bad things happen on devices with a badly designed platform firmware.
ok
Quoted 322 lines
Thanks,
Armin WolfQuoted 318 lines
Quoted 55 lines
Quoted 55 lines
+ if (ret < 0)
+ return ret;drivers/platform/x86/uniwill/uniwill-acpi.c +16
-0+ + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, 0); + if (ret < 0) + return ret; + + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_TPP_OFFSET, 255); + if (ret < 0) + return ret; + + ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_DB_OFFSET, 25); + if (ret < 0) + return ret; + + return 0; +} +static struct attribute *uniwill_attrs[] = {
/* Keyboard-related */
&dev_attr_fn_lock_toggle_enable.attr,drivers/platform/x86/uniwill/uniwill-acpi.c +2
-0@@ -810,6 +884,8 @@ static struct attribute *uniwill_attrs[] = { /* Lightbar-related */ &dev_attr_rainbow_animation.attr, &dev_attr_breathing_in_suspend.attr, + /* Power-management-related */ + &dev_attr_ctgp_offset.attr,NULL
};
@@ -839,6 +915,11 @@ staticumode_tuniwill_attr_is_visible(struct kobject *kobj, struct attribute *a returnattr->mode;
}
+ if (attr == &dev_attr_ctgp_offset.attr) {
+ if (uniwill_device_supports(data,UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
+ returnattr->mode;
+ }
+
return 0;
}
@@ -1405,6 +1486,10 @@ static intuniwill_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
+ ret =uniwill_nvidia_ctgp_init(data);
+ if (ret < 0)
+ return ret;
+
returnuniwill_input_init(data);
}
@@ -1545,6 +1630,28 @@ structuniwill_device_descriptorlapkc71f_descriptor__initdata= {UNIWILL_FEATURE_HWMON
};
+static intphxarx1_phxaqf1_probe(struct uniwill_data *data)
+{Quoted 8 lines
Quoted 6 lines
+ unsigned int value;
+ int ret;
+
+ ret =regmap_read(data->regmap, EC_ADDR_SYSTEM_ID, &value); + if (ret < 0)
+ return ret;Please add an empty line here.
kk
Quoted 10 lines
Quoted 10 lines
+ if (value &
HAS_GPU)
+data->features|=UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL;drivers/platform/x86/uniwill/uniwill-acpi.c +7
-0+ + return 0; +}; + +struct uniwill_device_descriptor phxarx1_phxaqf1_descriptor__initdata = { + .probe = phxarx1_phxaqf1_probe +};Quoted 8 lines
Quoted 6 lines
drivers/platform/x86/uniwill/uniwill-acpi.c +5
-0+ +struct uniwill_device_descriptor tux_featureset_1_descriptor__initdata = { + .features = UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL +}; +struct
uniwill_device_descriptorvoid_descriptor__initdata= {};I just noticed that all device descriptors are not marked as static. Please fix this.
ack, sorry overlooked that
Quick feedback if I should include the suspend disable anyway and I will wait a little bit to give Ilpo a chance to respond, but other than that: non RFC of this patchset incoming
Best regards,
Werner
Quoted 227 lines
Other than that, the patch looks very promising.
Thanks,
Armin WolfQuoted 221 lines
static const struct
dmi_system_iduniwill_dmi_table[]__initconst= {drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1594,7 +1701,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxTQx1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1602,7 +1709,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PHxARX1_PHxAQF1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen7 Intel/Commodore Omnia-Book Pro Gen 7",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1610,7 +1717,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6AG01_PH6AQ71_PH6AQI1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/16 Gen8 Intel/Commodore Omnia-Book Pro Gen 8",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1626,7 +1733,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH4PG31"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 16 Gen8 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1634,7 +1741,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "PH6PG01_PH6PG71"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO InfinityBook Pro 14/15 Gen9 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1802,7 +1909,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxMGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen2 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1810,7 +1917,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxNGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1818,7 +1925,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxZGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen3 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1826,7 +1933,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxTGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris/Polaris 15/17 Gen4 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1834,7 +1941,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxRGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 15 Gen4 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1842,7 +1949,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxAGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Polaris 15/17 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1850,7 +1957,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxXGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen5 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1858,7 +1965,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6XGxX"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16/17 Gen5 Intel/Commodore ORION Gen 5",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1866,7 +1973,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxPXxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1874,7 +1981,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GMxHGxx"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris Slim 15 Gen6 Intel/Commodore ORION Slim 15 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1882,7 +1989,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM5IXxA"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1890,7 +1997,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB1"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen6 Intel/Commodore ORION 16 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1898,7 +2005,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM6IXxB_MB2"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 17 Gen6 Intel/Commodore ORION 17 Gen6",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1906,7 +2013,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "GM7IXxN"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 AMD",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1914,7 +2021,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6FR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1922,7 +2029,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Stellaris 16 Gen7 Intel",
drivers/platform/x86/uniwill/uniwill-acpi.c +1
-1@@ -1930,7 +2037,7 @@ static const struct dmi_system_id uniwill_dmi_table[]__initconst = { DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), }, - .driver_data = &void_descriptor, + .driver_data = &tux_featureset_1_descriptor, }, {.ident = "TUXEDO Pulse 14 Gen1 AMD",