Commit 6a758a3e authored by Kristian Angelov's avatar Kristian Angelov Committed by Hans de Goede

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/443078148.491022.1677576298133@nm83.abv.bgSigned-off-by: default avatarKristian Angelov <kristiana2000@abv.bg>
Reviewed-by: default avatarLuke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/ZLlS7o6UdTUBkyqa@wyvern.localdomainReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 1da0893a
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment