New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UX8406 (Zenbook Duo 2024) support #25
Comments
Here's my keyboard work so far (from my post on a NixOS forum thread)
|
Excellent work! I applied this patch to my kernel though and didn't experience working hotkeys over bluetooth... in fact no keys were working. I checked the logs and it seems that when connecting the bluetooth keyboard, the hid data failed to parse...
This seems related to the tweak you've made to |
Strange. I just tried applying the patch directly myself, and the keyboard with hotkeys worked fine, but the touchpad wasn't showing up... Are you able to upload the contents of all files matching |
On the topic of power profiles, here's a patch that should get them working. The firmware API seems to match the Vivobook Pro 16X 2023 (K6604). I'm actually pretty happy with this, so I guess it's time to learn how to send a kernel patch upstream 😅 . Click to expandFrom 2f8f8e6bb2da47c677a07f76f141c527ddd5d51c Mon Sep 17 00:00:00 2001
From: hacker1024 <hacker1024@users.sourceforge.net>
Date: Fri, 12 Apr 2024 13:59:24 +1000
Subject: [PATCH] asus-wmi: Add additional DEVID_THROTTLE_THERMAL_POLICY
---
drivers/platform/x86/asus-wmi.c | 102 +++++++++++++++------
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 76 insertions(+), 27 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 18be35fdb381..c7958b31dae0 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -93,9 +93,13 @@ module_param(fnlock_default, bool, 0444);
#define ASUS_FAN_BOOST_MODE_SILENT_MASK 0x02
#define ASUS_FAN_BOOST_MODES_MASK 0x03
+#define ASUS_THROTTLE_THERMAL_POLICY_COUNT 3
#define ASUS_THROTTLE_THERMAL_POLICY_DEFAULT 0
#define ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST 1
#define ASUS_THROTTLE_THERMAL_POLICY_SILENT 2
+#define ASUS_THROTTLE_THERMAL_POLICY_LITE_DEFAULT 0
+#define ASUS_THROTTLE_THERMAL_POLICY_LITE_OVERBOOST 2
+#define ASUS_THROTTLE_THERMAL_POLICY_LITE_SILENT 1
#define USB_INTEL_XUSB2PR 0xD0
#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
@@ -282,6 +286,7 @@ struct asus_wmi {
bool kbd_rgb_state_available;
bool throttle_thermal_policy_available;
+ bool throttle_thermal_policy_lite;
u8 throttle_thermal_policy_mode;
bool cpu_fan_curve_available;
@@ -3404,6 +3409,14 @@ static int throttle_thermal_policy_check_present(struct asus_wmi *asus)
err = asus_wmi_get_devstate(asus,
ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY,
&result);
+ if (err == -ENODEV) {
+ err = asus_wmi_get_devstate(asus,
+ ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_LITE,
+ &result);
+ asus->throttle_thermal_policy_lite = true;
+ } else {
+ asus->throttle_thermal_policy_lite = false;
+ }
if (err) {
if (err == -ENODEV)
return 0;
@@ -3424,7 +3437,10 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus)
value = asus->throttle_thermal_policy_mode;
- err = asus_wmi_set_devstate(ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY,
+ err = asus_wmi_set_devstate(
+ asus->throttle_thermal_policy_lite
+ ? ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_LITE
+ : ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY,
value, &retval);
sysfs_notify(&asus->platform_device->dev.kobj, NULL,
@@ -3466,7 +3482,7 @@ static int throttle_thermal_policy_switch_next(struct asus_wmi *asus)
u8 new_mode = asus->throttle_thermal_policy_mode + 1;
int err;
- if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT)
+ if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_COUNT - 1)
new_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
asus->throttle_thermal_policy_mode = new_mode;
@@ -3505,7 +3521,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev,
if (result < 0)
return result;
- if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT)
+ if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_COUNT - 1)
return -EINVAL;
asus->throttle_thermal_policy_mode = new_mode;
@@ -3536,18 +3552,34 @@ static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof,
tp = asus->throttle_thermal_policy_mode;
- switch (tp) {
- case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT:
- *profile = PLATFORM_PROFILE_BALANCED;
- break;
- case ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST:
- *profile = PLATFORM_PROFILE_PERFORMANCE;
- break;
- case ASUS_THROTTLE_THERMAL_POLICY_SILENT:
- *profile = PLATFORM_PROFILE_QUIET;
- break;
- default:
- return -EINVAL;
+ if (!asus->throttle_thermal_policy_lite) {
+ switch (tp) {
+ case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT:
+ *profile = PLATFORM_PROFILE_BALANCED;
+ break;
+ case ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST:
+ *profile = PLATFORM_PROFILE_PERFORMANCE;
+ break;
+ case ASUS_THROTTLE_THERMAL_POLICY_SILENT:
+ *profile = PLATFORM_PROFILE_QUIET;
+ break;
+ default:
+ return -EINVAL;
+ }
+ } else {
+ switch (tp) {
+ case ASUS_THROTTLE_THERMAL_POLICY_LITE_DEFAULT:
+ *profile = PLATFORM_PROFILE_BALANCED;
+ break;
+ case ASUS_THROTTLE_THERMAL_POLICY_LITE_OVERBOOST:
+ *profile = PLATFORM_PROFILE_PERFORMANCE;
+ break;
+ case ASUS_THROTTLE_THERMAL_POLICY_LITE_SILENT:
+ *profile = PLATFORM_PROFILE_QUIET;
+ break;
+ default:
+ return -EINVAL;
+ }
}
return 0;
@@ -3561,18 +3593,34 @@ static int asus_wmi_platform_profile_set(struct platform_profile_handler *pprof,
asus = container_of(pprof, struct asus_wmi, platform_profile_handler);
- switch (profile) {
- case PLATFORM_PROFILE_PERFORMANCE:
- tp = ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST;
- break;
- case PLATFORM_PROFILE_BALANCED:
- tp = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
- break;
- case PLATFORM_PROFILE_QUIET:
- tp = ASUS_THROTTLE_THERMAL_POLICY_SILENT;
- break;
- default:
- return -EOPNOTSUPP;
+ if (!asus->throttle_thermal_policy_lite) {
+ switch (profile) {
+ case PLATFORM_PROFILE_PERFORMANCE:
+ tp = ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST;
+ break;
+ case PLATFORM_PROFILE_BALANCED:
+ tp = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
+ break;
+ case PLATFORM_PROFILE_QUIET:
+ tp = ASUS_THROTTLE_THERMAL_POLICY_SILENT;
+ break;
+ default:
+ return -EOPNOTSUPP;
+ }
+ } else {
+ switch (profile) {
+ case PLATFORM_PROFILE_PERFORMANCE:
+ tp = ASUS_THROTTLE_THERMAL_POLICY_LITE_OVERBOOST;
+ break;
+ case PLATFORM_PROFILE_BALANCED:
+ tp = ASUS_THROTTLE_THERMAL_POLICY_LITE_DEFAULT;
+ break;
+ case PLATFORM_PROFILE_QUIET:
+ tp = ASUS_THROTTLE_THERMAL_POLICY_LITE_SILENT;
+ break;
+ default:
+ return -EOPNOTSUPP;
+ }
}
asus->throttle_thermal_policy_mode = tp;
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index ab1c7deff118..ddf5b3766cd2 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -64,6 +64,7 @@
#define ASUS_WMI_DEVID_SCREENPAD_LIGHT 0x00050032
#define ASUS_WMI_DEVID_FAN_BOOST_MODE 0x00110018
#define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY 0x00120075
+#define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_LITE 0x00110019
/* Misc */
#define ASUS_WMI_DEVID_PANEL_OD 0x00050019
--
2.44.0 Of course, if you don't want to bother with a kernel patch, you can do it over the CLI - # echo 0x00110019 > /sys/kernel/debug/asus-nb-wmi/dev_id
# echo 0x0 > /sys/kernel/debug/asus-nb-wmi/ctrl_param
# cat /sys/kernel/debug/asus-nb-wmi/devs Interestingly, there's another ACPI endpoint that relates to the fan. It seems to set the Intel Dynamic Platform and Thermal Framework OEM variable 3 and call an EC function based on the given argument (0-3) and fan setting. Search for Has anyone more experienced with ACPI, DPTF or ECs seen anything like this before? |
Following this! Thanks a lot for your work so far, @hacker1024 |
I'm creating this umbrella issue to discuss all features UX8406-related.
To start, here's a list of known issues:
Keyboard
Display
Power
The text was updated successfully, but these errors were encountered: