Skip to content

Commit

Permalink
platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
meganukebmp authored and jwrdegoede committed Jul 25, 2023
1 parent 1da0893 commit 6a758a3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6a758a3

Please sign in to comment.