Patch "platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     platform-x86-asus-wmi-fix-setting-rgb-mode-on-some-t.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5c335a2ed59256fa5a20a6eef9e7f46509dcdad4
Author: Kristian Angelov <kristiana2000@xxxxxx>
Date:   Thu Jul 20 18:29:50 2023 +0300

    platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops
    
    [ Upstream commit 6a758a3e831ce1a84c9c209ac6dc755f4c8ce77a ]
    
    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@xxxxxxxxxxx
    Signed-off-by: Kristian Angelov <kristiana2000@xxxxxx>
    Reviewed-by: Luke D. Jones <luke@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/ZLlS7o6UdTUBkyqa@wyvern.localdomain
    Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 1038dfdcdd325..8bef66a2f0ce7 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)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux