summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/asus-wmi.c
diff options
context:
space:
mode:
authorVasiliy Kupriakov <rublag-ns@yandex.ru>2020-08-29 00:49:30 +0300
committerHans de Goede <hdegoede@redhat.com>2020-11-24 16:39:13 +0300
commit72ceec58685f8a5c2ec22d9617c7b1e239e2e809 (patch)
treebd1a1bd11d354ea8fb599a4f3b4defa877633f0c /drivers/platform/x86/asus-wmi.c
parentbb81dcd4eda208d00c3dc3372792da497813e958 (diff)
downloadlinux-72ceec58685f8a5c2ec22d9617c7b1e239e2e809.tar.xz
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>
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r--drivers/platform/x86/asus-wmi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index fa884c418f4e..9ca15f724343 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1690,6 +1690,10 @@ static int fan_boost_mode_write(struct asus_wmi *asus)
pr_info("Set fan boost mode: %u\n", value);
err = asus_wmi_set_devstate(ASUS_WMI_DEVID_FAN_BOOST_MODE, value,
&retval);
+
+ sysfs_notify(&asus->platform_device->dev.kobj, NULL,
+ "fan_boost_mode");
+
if (err) {
pr_warn("Failed to set fan boost mode: %d\n", err);
return err;
@@ -1801,6 +1805,10 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus)
err = asus_wmi_set_devstate(ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY,
value, &retval);
+
+ sysfs_notify(&asus->platform_device->dev.kobj, NULL,
+ "throttle_thermal_policy");
+
if (err) {
pr_warn("Failed to set throttle thermal policy: %d\n", err);
return err;