diff options
author | Kristian Angelov <[email protected]> | 2023-07-20 18:29:50 +0300 |
---|---|---|
committer | Hans de Goede <[email protected]> | 2023-07-25 15:38:44 +0200 |
commit | 6a758a3e831ce1a84c9c209ac6dc755f4c8ce77a (patch) | |
tree | 148cdeb1a3d3417932e0f10693bd4efe4a8df04d | |
parent | 1da0893aed2e48e2bdf37c29b029f2e060d25927 (diff) |
platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops
This patch fixes setting the cmd values to 0xb3 and 0xb4.
This is necessary on some TUF laptops in order to set the RGB mode.
Closes: https://lore.kernel.org/platform-driver-x86/[email protected]
Signed-off-by: Kristian Angelov <[email protected]>
Reviewed-by: Luke D. Jones <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 1038dfdcdd32..8bef66a2f0ce 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -738,13 +738,23 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - u32 cmd, mode, r, g, b, speed; + u32 cmd, mode, r, g, b, speed; int err; if (sscanf(buf, "%d %d %d %d %d %d", &cmd, &mode, &r, &g, &b, &speed) != 6) return -EINVAL; - cmd = !!cmd; + /* B3 is set and B4 is save to BIOS */ + switch (cmd) { + case 0: + cmd = 0xb3; + break; + case 1: + cmd = 0xb4; + break; + default: + return -EINVAL; + } /* These are the known usable modes across all TUF/ROG */ if (mode >= 12 || mode == 9) |