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
[ Upstream commit 6a758a3 ]

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.bg
Signed-off-by: Kristian Angelov <kristiana2000@abv.bg>
Reviewed-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/ZLlS7o6UdTUBkyqa@wyvern.localdomain
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
meganukebmp authored and gregkh committed Sep 13, 2023
1 parent aeee50c commit 5c56282
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/platform/x86/asus-wmi.c
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 5c56282

Please sign in to comment.