X86 platform drivers
 help / color / mirror / Atom feed
From: Luke Jones <luke@ljones.dev>
To: Kristian Angelov <kristiana2000@abv.bg>
Cc: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH V3] platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops
Date: Fri, 21 Jul 2023 10:30:12 +1200	[thread overview]
Message-ID: <C694YR.K5DWX6WG90S31@ljones.dev> (raw)
In-Reply-To: <ZLlS7o6UdTUBkyqa@wyvern.localdomain>

Looks good to me.

Reviewed-by: Luke D. Jones <luke@ljones.dev>

On Thu, Jul 20 2023 at 18:29:50 +03:00:00, Kristian Angelov 
<kristiana2000@abv.bg> wrote:
> 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>
> ---
>  V1 -> V2. Make setting 0xb3 and 0xb4 the default logic
>  V2 -> V3. Defualt to -EINVAL to match the rest of asus-wmi.
> 
>  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 1038dfdcdd32..8bef66a2f0ce 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.0
> 



  reply	other threads:[~2023-07-20 22:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 15:29 [PATCH V3] platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops Kristian Angelov
2023-07-20 22:30 ` Luke Jones [this message]
2023-07-25 13:40   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C694YR.K5DWX6WG90S31@ljones.dev \
    --to=luke@ljones.dev \
    --cc=hdegoede@redhat.com \
    --cc=kristiana2000@abv.bg \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox