From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B4A511706 for ; Mon, 11 Sep 2023 15:02:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF767C433C8; Mon, 11 Sep 2023 15:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694444566; bh=8/miCyw6MFTBO4OXy+eS7Y72BjtwUgpaOAWN8mtIS6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kFHNWoWRI8684IBMbH9k9c7C2euxLObaW5qxK+VDi3cJP6rzIjj2p+YqDWwYNkNMx VOEvKrJWThraOZ3xbmOoIFx4zWBcNQsqTlU8wyfSNXsPPzeXX+rG9mjYyx8CCDJLNm AW3dz1e6Mzx2Rr8tv0ToQUCpOHXcqVEn4+y2bwm0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kristian Angelov , "Luke D. Jones" , Hans de Goede , Sasha Levin Subject: [PATCH 6.1 037/600] platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops Date: Mon, 11 Sep 2023 15:41:10 +0200 Message-ID: <20230911134634.695363646@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134633.619970489@linuxfoundation.org> References: <20230911134633.619970489@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kristian Angelov [ 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@nm83.abv.bg Signed-off-by: Kristian Angelov Reviewed-by: Luke D. Jones Link: https://lore.kernel.org/r/ZLlS7o6UdTUBkyqa@wyvern.localdomain Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/x86/asus-wmi.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 02bf286924183..36effe04c6f33 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) -- 2.40.1