platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Luke D. Jones" <luke@ljones.dev>
Cc: "Hans de Goede" <hdegoede@redhat.com>,
	"Barnabás Pőcze" <pobrn@protonmail.com>,
	"Pavel Machek" <pavel@ucw.cz>,
	"Platform Driver" <platform-driver-x86@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/6] asus-wmi: Implement TUF laptop keyboard LED modes
Date: Tue, 9 Aug 2022 11:22:55 +0200	[thread overview]
Message-ID: <CAHp75VdrWMD7A2PJ-nPa0aLYZPqmgC7+pZ2SMDMtGWjHrx=xxA@mail.gmail.com> (raw)
In-Reply-To: <20220809025054.1626339-3-luke@ljones.dev>

On Tue, Aug 9, 2022 at 4:51 AM Luke D. Jones <luke@ljones.dev> wrote:
>
> Adds support for changing the laptop keyboard LED modes. These
> are visible effects such as static, rainbow, pulsing, colour cycles.
>
> These sysfs attributes are added to asus-nb-wmi:
> - keyboard_rgb_save
> - keyboard_rgb_mode
> - keyboard_rgb_speed

...

> +What:          /sys/devices/platform/<platform>/keyboard_rgb_speed
> +Date:          Aug 2022
> +KernelVersion: 6.1
> +Contact:       "Luke Jones" <luke@ljones.dev>
> +Description:
> +               Set the speed of the selected RGB effect, the speed will not apply
> +               until the keyboard_rgb_save attribute is set (write-only):
> +                       * 0 - slow
> +                       * 1 - medium
> +                       * 2 - fast

> \ No newline at end of file

^^^

...

> +       u8 save;
> +       int err;

> +
> +       struct asus_wmi *asus = dev_get_drvdata(device);
> +       struct led_classdev *cdev = &asus->keyboard_rgb_led.dev.led_cdev;

No blank line in the definition block and try to keep "the longest
line first", a.k.a. reversed xmas tree ordering.

...

> +       u8 mode;
> +
> +       struct asus_wmi *asus = dev_get_drvdata(device);

Ditto.

I would really recommend you spending some time to read the existing
code (better recent one) and look for the common patterns.

...

> +       /* These are the known usable modes across all TUF/ROG */
> +       if (mode >= 12 || mode == 10)

The second condition was different in previous versions. Or am I
confused by another patch series?

> +         asus->keyboard_rgb_led.mode = 10;
> +       else
> +         asus->keyboard_rgb_led.mode = mode;

...

> +
> +

Single blank line is enough.

...

> -               struct mc_subled *mc_led_info = asus->keyboard_rgb_mode.subled_info;
> -               struct led_classdev_mc *mc_cdev = &asus->keyboard_rgb_mode.dev;
> +               struct mc_subled *mc_led_info = asus->keyboard_rgb_led.subled_info;
> +               struct led_classdev_mc *mc_cdev = &asus->keyboard_rgb_led.dev;

Not sure why this change happened...

> -               asus->keyboard_rgb_mode.save = 1;
> -               asus->keyboard_rgb_mode.mode = 0;
> -               asus->keyboard_rgb_mode.speed = 0xeb;
> +               asus->keyboard_rgb_led.save = 1;
> +               asus->keyboard_rgb_led.mode = 0;
> +               asus->keyboard_rgb_led.speed = 0xeb;

...and this.
Is it some kind of renaming? Can you split it to another patch if it
was initially like that?

-- 
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2022-08-09  9:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09  2:50 [PATCH v3 0/6] asus-wmi: Add support for RGB keyboards Luke D. Jones
2022-08-09  2:50 ` [PATCH v3 1/6] asus-wmi: Implement TUF laptop keyboard RGB control Luke D. Jones
2022-08-09  8:46   ` Andy Shevchenko
2022-08-09  8:55     ` Luke Jones
2022-08-09  9:29       ` Andy Shevchenko
2022-08-09  9:31         ` Luke Jones
2022-08-09 10:50   ` Pavel Machek
2022-08-10  4:44     ` Luke Jones
2022-08-11 15:01       ` Hans de Goede
2022-08-11 15:05         ` Hans de Goede
2022-08-11 22:13           ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 2/6] asus-wmi: Implement TUF laptop keyboard LED modes Luke D. Jones
2022-08-09  3:16   ` Luke Jones
2022-08-09  9:22   ` Andy Shevchenko [this message]
2022-08-09  9:30     ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 3/6] asus-wmi: Implement TUF laptop keyboard power states Luke D. Jones
2022-08-09  8:52   ` Andy Shevchenko
2022-08-09  8:58     ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 4/6] asus-wmi: Document previously added attributes Luke D. Jones
2022-08-09  9:25   ` Andy Shevchenko
2022-08-11 15:08     ` Hans de Goede
2022-08-11 22:08       ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 5/6] asus-wmi: Convert all attr-show to use sysfs_emit Luke D. Jones
2022-08-09  9:27   ` Andy Shevchenko
2022-08-11 18:52     ` Hans de Goede
2022-08-09  2:50 ` [PATCH v3 6/6] asus-wmi: Support the hardware GPU MUX on some laptops Luke D. Jones
2022-08-09  7:19   ` Luke Jones
2022-08-11 13:53   ` Hans de Goede
2022-08-11 22:01     ` Luke Jones
2022-08-12  7:59       ` Hans de Goede
2022-08-12  8:31         ` Thomas Weißschuh
2022-08-12  8:44           ` Hans de Goede
2022-08-09  8:55 ` [PATCH v3 0/6] asus-wmi: Add support for RGB keyboards Andy Shevchenko

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='CAHp75VdrWMD7A2PJ-nPa0aLYZPqmgC7+pZ2SMDMtGWjHrx=xxA@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=pobrn@protonmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).