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

platform/x86: asus-wmi: Add userspace notification for performance mode change

When user presses Fn-F5, the driver automatically changes throttle
thermal policy (or fan boost mode, depending on laptop model).

It would be convenient for userspace software to be able to poll on
corresponding sysfs variable. For example, to show a notification about
mode change.

Note that there is currently no way to handle Fn-F5 from userspace
directly, driver does not pass it.

Signed-off-by: Vasiliy Kupriakov <rublag-ns@yandex.ru>
Link: https://lore.kernel.org/r/20200828214932.20866-2-rublag-ns@yandex.ru
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Vasiliy Kupriakov and committed by
Hans de Goede
72ceec58 bb81dcd4

+8
+8
drivers/platform/x86/asus-wmi.c
··· 1690 1690 pr_info("Set fan boost mode: %u\n", value); 1691 1691 err = asus_wmi_set_devstate(ASUS_WMI_DEVID_FAN_BOOST_MODE, value, 1692 1692 &retval); 1693 + 1694 + sysfs_notify(&asus->platform_device->dev.kobj, NULL, 1695 + "fan_boost_mode"); 1696 + 1693 1697 if (err) { 1694 1698 pr_warn("Failed to set fan boost mode: %d\n", err); 1695 1699 return err; ··· 1805 1801 1806 1802 err = asus_wmi_set_devstate(ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY, 1807 1803 value, &retval); 1804 + 1805 + sysfs_notify(&asus->platform_device->dev.kobj, NULL, 1806 + "throttle_thermal_policy"); 1807 + 1808 1808 if (err) { 1809 1809 pr_warn("Failed to set throttle thermal policy: %d\n", err); 1810 1810 return err;