Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: uniwill-laptop: Rename FN lock and super key lock attrs

It turns out that both sysfs attributes actually directly control
the FN lock status/super key enable status, rather than the
triggering of the associated events. This behavior was first observed
on a Tuxedo notebook and was belived to be a hardware quirk.
However, it seems that i simply misunderstood the manual of the
OEM software for Intel NUC devices. The correct behavior is:

- fn_lock_toggle_enable enables/disables FN lock mode
- super_key_toggle_enable enables/disables the super key

Rename both sysfs attributes to avoid confusing users.

Fixes: d050479693bb ("platform/x86: Add Uniwill laptop driver")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260218005101.73680-2-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Armin Wolf and committed by
Ilpo Järvinen
2d53dfac e3aa6fea

+39 -37
+5 -5
Documentation/ABI/testing/sysfs-driver-uniwill-laptop
··· 1 - What: /sys/bus/platform/devices/INOU0000:XX/fn_lock_toggle_enable 1 + What: /sys/bus/platform/devices/INOU0000:XX/fn_lock 2 2 Date: November 2025 3 3 KernelVersion: 6.19 4 4 Contact: Armin Wolf <W_Armin@gmx.de> ··· 8 8 9 9 Reading this file returns the current enable status of the FN lock functionality. 10 10 11 - What: /sys/bus/platform/devices/INOU0000:XX/super_key_toggle_enable 11 + What: /sys/bus/platform/devices/INOU0000:XX/super_key_enable 12 12 Date: November 2025 13 13 KernelVersion: 6.19 14 14 Contact: Armin Wolf <W_Armin@gmx.de> 15 15 Description: 16 - Allows userspace applications to enable/disable the super key functionality 17 - of the integrated keyboard by writing "1"/"0" into this file. 16 + Allows userspace applications to enable/disable the super key of the integrated 17 + keyboard by writing "1"/"0" into this file. 18 18 19 - Reading this file returns the current enable status of the super key functionality. 19 + Reading this file returns the current enable status of the super key. 20 20 21 21 What: /sys/bus/platform/devices/INOU0000:XX/touchpad_toggle_enable 22 22 Date: November 2025
+1 -1
Documentation/admin-guide/laptops/uniwill-laptop.rst
··· 24 24 25 25 The ``uniwill-laptop`` driver allows the user to enable/disable: 26 26 27 - - the FN and super key lock functionality of the integrated keyboard 27 + - the FN lock and super key of the integrated keyboard 28 28 - the touchpad toggle functionality of the integrated touchpad 29 29 30 30 See Documentation/ABI/testing/sysfs-driver-uniwill-laptop for details.
+30 -28
drivers/platform/x86/uniwill/uniwill-acpi.c
··· 314 314 #define LED_CHANNELS 3 315 315 #define LED_MAX_BRIGHTNESS 200 316 316 317 - #define UNIWILL_FEATURE_FN_LOCK_TOGGLE BIT(0) 318 - #define UNIWILL_FEATURE_SUPER_KEY_TOGGLE BIT(1) 317 + #define UNIWILL_FEATURE_FN_LOCK BIT(0) 318 + #define UNIWILL_FEATURE_SUPER_KEY BIT(1) 319 319 #define UNIWILL_FEATURE_TOUCHPAD_TOGGLE BIT(2) 320 320 #define UNIWILL_FEATURE_LIGHTBAR BIT(3) 321 321 #define UNIWILL_FEATURE_BATTERY BIT(4) ··· 377 377 { KE_IGNORE, UNIWILL_OSD_CAPSLOCK, { KEY_CAPSLOCK }}, 378 378 { KE_IGNORE, UNIWILL_OSD_NUMLOCK, { KEY_NUMLOCK }}, 379 379 380 - /* Reported when the user locks/unlocks the super key */ 381 - { KE_IGNORE, UNIWILL_OSD_SUPER_KEY_LOCK_ENABLE, { KEY_UNKNOWN }}, 382 - { KE_IGNORE, UNIWILL_OSD_SUPER_KEY_LOCK_DISABLE, { KEY_UNKNOWN }}, 380 + /* 381 + * Reported when the user enables/disables the super key. 382 + * Those events might even be reported when the change was done 383 + * using the sysfs attribute! 384 + */ 385 + { KE_IGNORE, UNIWILL_OSD_SUPER_KEY_DISABLE, { KEY_UNKNOWN }}, 386 + { KE_IGNORE, UNIWILL_OSD_SUPER_KEY_ENABLE, { KEY_UNKNOWN }}, 383 387 /* Optional, might not be reported by all devices */ 384 - { KE_IGNORE, UNIWILL_OSD_SUPER_KEY_LOCK_CHANGED, { KEY_UNKNOWN }}, 388 + { KE_IGNORE, UNIWILL_OSD_SUPER_KEY_STATE_CHANGED, { KEY_UNKNOWN }}, 385 389 386 390 /* Reported in manual mode when toggling the airplane mode status */ 387 391 { KE_KEY, UNIWILL_OSD_RFKILL, { KEY_RFKILL }}, ··· 604 600 .use_single_write = true, 605 601 }; 606 602 607 - static ssize_t fn_lock_toggle_enable_store(struct device *dev, struct device_attribute *attr, 608 - const char *buf, size_t count) 603 + static ssize_t fn_lock_store(struct device *dev, struct device_attribute *attr, const char *buf, 604 + size_t count) 609 605 { 610 606 struct uniwill_data *data = dev_get_drvdata(dev); 611 607 unsigned int value; ··· 628 624 return count; 629 625 } 630 626 631 - static ssize_t fn_lock_toggle_enable_show(struct device *dev, struct device_attribute *attr, 632 - char *buf) 627 + static ssize_t fn_lock_show(struct device *dev, struct device_attribute *attr, char *buf) 633 628 { 634 629 struct uniwill_data *data = dev_get_drvdata(dev); 635 630 unsigned int value; ··· 641 638 return sysfs_emit(buf, "%d\n", !!(value & FN_LOCK_STATUS)); 642 639 } 643 640 644 - static DEVICE_ATTR_RW(fn_lock_toggle_enable); 641 + static DEVICE_ATTR_RW(fn_lock); 645 642 646 - static ssize_t super_key_toggle_enable_store(struct device *dev, struct device_attribute *attr, 647 - const char *buf, size_t count) 643 + static ssize_t super_key_enable_store(struct device *dev, struct device_attribute *attr, 644 + const char *buf, size_t count) 648 645 { 649 646 struct uniwill_data *data = dev_get_drvdata(dev); 650 647 unsigned int value; ··· 676 673 return count; 677 674 } 678 675 679 - static ssize_t super_key_toggle_enable_show(struct device *dev, struct device_attribute *attr, 680 - char *buf) 676 + static ssize_t super_key_enable_show(struct device *dev, struct device_attribute *attr, char *buf) 681 677 { 682 678 struct uniwill_data *data = dev_get_drvdata(dev); 683 679 unsigned int value; ··· 689 687 return sysfs_emit(buf, "%d\n", !(value & SUPER_KEY_LOCK_STATUS)); 690 688 } 691 689 692 - static DEVICE_ATTR_RW(super_key_toggle_enable); 690 + static DEVICE_ATTR_RW(super_key_enable); 693 691 694 692 static ssize_t touchpad_toggle_enable_store(struct device *dev, struct device_attribute *attr, 695 693 const char *buf, size_t count) ··· 883 881 884 882 static struct attribute *uniwill_attrs[] = { 885 883 /* Keyboard-related */ 886 - &dev_attr_fn_lock_toggle_enable.attr, 887 - &dev_attr_super_key_toggle_enable.attr, 884 + &dev_attr_fn_lock.attr, 885 + &dev_attr_super_key_enable.attr, 888 886 &dev_attr_touchpad_toggle_enable.attr, 889 887 /* Lightbar-related */ 890 888 &dev_attr_rainbow_animation.attr, ··· 899 897 struct device *dev = kobj_to_dev(kobj); 900 898 struct uniwill_data *data = dev_get_drvdata(dev); 901 899 902 - if (attr == &dev_attr_fn_lock_toggle_enable.attr) { 903 - if (uniwill_device_supports(data, UNIWILL_FEATURE_FN_LOCK_TOGGLE)) 900 + if (attr == &dev_attr_fn_lock.attr) { 901 + if (uniwill_device_supports(data, UNIWILL_FEATURE_FN_LOCK)) 904 902 return attr->mode; 905 903 } 906 904 907 - if (attr == &dev_attr_super_key_toggle_enable.attr) { 908 - if (uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) 905 + if (attr == &dev_attr_super_key_enable.attr) { 906 + if (uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY)) 909 907 return attr->mode; 910 908 } 911 909 ··· 1507 1505 1508 1506 static int uniwill_suspend_keyboard(struct uniwill_data *data) 1509 1507 { 1510 - if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) 1508 + if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY)) 1511 1509 return 0; 1512 1510 1513 1511 /* ··· 1567 1565 unsigned int value; 1568 1566 int ret; 1569 1567 1570 - if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY_TOGGLE)) 1568 + if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY)) 1571 1569 return 0; 1572 1570 1573 1571 ret = regmap_read(data->regmap, EC_ADDR_SWITCH_STATUS, &value); ··· 1645 1643 }; 1646 1644 1647 1645 static struct uniwill_device_descriptor lapac71h_descriptor __initdata = { 1648 - .features = UNIWILL_FEATURE_FN_LOCK_TOGGLE | 1649 - UNIWILL_FEATURE_SUPER_KEY_TOGGLE | 1646 + .features = UNIWILL_FEATURE_FN_LOCK | 1647 + UNIWILL_FEATURE_SUPER_KEY | 1650 1648 UNIWILL_FEATURE_TOUCHPAD_TOGGLE | 1651 1649 UNIWILL_FEATURE_BATTERY | 1652 1650 UNIWILL_FEATURE_HWMON, 1653 1651 }; 1654 1652 1655 1653 static struct uniwill_device_descriptor lapkc71f_descriptor __initdata = { 1656 - .features = UNIWILL_FEATURE_FN_LOCK_TOGGLE | 1657 - UNIWILL_FEATURE_SUPER_KEY_TOGGLE | 1654 + .features = UNIWILL_FEATURE_FN_LOCK | 1655 + UNIWILL_FEATURE_SUPER_KEY | 1658 1656 UNIWILL_FEATURE_TOUCHPAD_TOGGLE | 1659 1657 UNIWILL_FEATURE_LIGHTBAR | 1660 1658 UNIWILL_FEATURE_BATTERY |
+3 -3
drivers/platform/x86/uniwill/uniwill-wmi.h
··· 64 64 #define UNIWILL_OSD_KB_LED_LEVEL3 0x3E 65 65 #define UNIWILL_OSD_KB_LED_LEVEL4 0x3F 66 66 67 - #define UNIWILL_OSD_SUPER_KEY_LOCK_ENABLE 0x40 68 - #define UNIWILL_OSD_SUPER_KEY_LOCK_DISABLE 0x41 67 + #define UNIWILL_OSD_SUPER_KEY_DISABLE 0x40 68 + #define UNIWILL_OSD_SUPER_KEY_ENABLE 0x41 69 69 70 70 #define UNIWILL_OSD_MENU_JP 0x42 71 71 ··· 74 74 75 75 #define UNIWILL_OSD_RFKILL 0xA4 76 76 77 - #define UNIWILL_OSD_SUPER_KEY_LOCK_CHANGED 0xA5 77 + #define UNIWILL_OSD_SUPER_KEY_STATE_CHANGED 0xA5 78 78 79 79 #define UNIWILL_OSD_LIGHTBAR_STATE_CHANGED 0xA6 80 80