From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Antheas Kapenekakis <lkml@antheas.dev>
Cc: platform-driver-x86@vger.kernel.org, linux-input@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
Corentin Chary <corentin.chary@gmail.com>,
"Luke D . Jones" <luke@ljones.dev>,
Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH v5 09/11] HID: asus: add basic RGB support
Date: Wed, 26 Mar 2025 12:24:53 +0200 (EET) [thread overview]
Message-ID: <43c4dd17-de34-804f-7080-b287ac4a0cac@linux.intel.com> (raw)
In-Reply-To: <CAGwozwF8PZczpqOFm3ONDdJTVCgcWOZ8mXrASbmiAXUhQvOhdg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4928 bytes --]
On Wed, 26 Mar 2025, Antheas Kapenekakis wrote:
> On Wed, 26 Mar 2025 at 09:54, Ilpo Järvinen
> <ilpo.jarvinen@linux.intel.com> wrote:
> >
> > On Tue, 25 Mar 2025, Antheas Kapenekakis wrote:
> >
> > > Adds basic RGB support to hid-asus through multi-index. The interface
> > > works quite well, but has not gone through much stability testing.
> > > Applied on demand, if userspace does not touch the RGB sysfs, not
> > > even initialization is done. Ensuring compatibility with existing
> > > userspace programs.
> > >
> > > Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> > > ---
> > > drivers/hid/Kconfig | 1 +
> > > drivers/hid/hid-asus.c | 171 +++++++++++++++++++++++++++++++++++++----
> > > 2 files changed, 156 insertions(+), 16 deletions(-)
> > >
> > > diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> > > index dfc245867a46a..d324c6ab997de 100644
> > > + };
> > > + unsigned long flags;
> > > + uint8_t colors[3];
> > > + bool rgb_init, rgb_set;
> > > + int ret;
> > > +
> > > + spin_lock_irqsave(&led->lock, flags);
> > > + rgb_init = led->rgb_init;
> > > + rgb_set = led->rgb_set;
> > > + led->rgb_set = false;
> > > + colors[0] = led->rgb_colors[0];
> > > + colors[1] = led->rgb_colors[1];
> > > + colors[2] = led->rgb_colors[2];
> > > + spin_unlock_irqrestore(&led->lock, flags);
> > > +
> > > + if (!rgb_set)
> > > + return;
> > > +
> > > + if (rgb_init) {
> > > + ret = asus_kbd_init(led->hdev, FEATURE_KBD_LED_REPORT_ID1);
> > > + if (ret < 0) {
> > > + hid_err(led->hdev, "Asus failed to init RGB: %d\n", ret);
> > > + return;
> > > + }
> > > + spin_lock_irqsave(&led->lock, flags);
> > > + led->rgb_init = false;
> > > + spin_unlock_irqrestore(&led->lock, flags);
> > > + }
> > > +
> > > + /* Protocol is: 54b3 zone (0=all) mode (0=solid) RGB */
> >
> > BTW, this comment is very cryptic to me and I'm unable to connect it with
> > the code below. My only guess is that each non-parenthesized word is
> > explaining one index but things don't add up given what rgb_buf[0][0] and
> > [0][1] have.
>
> Maybe i fatfingered 54 and it should be 5a. Protocol is 54b3 zone mode
> R G B. So colors go to indexes 4, 5, 6
Ah. I suggest you add the spaces between the bytes to make it more
obvious. Although, this could be a constructed as struct as well in which
case the struct itself would document the format without need to
cryptic comments nor use of numeric indexes.
> > > + rgb_buf[0][4] = colors[0];
> > > + rgb_buf[0][5] = colors[1];
> > > + rgb_buf[0][6] = colors[2];
> > > +
> > > + for (size_t i = 0; i < ARRAY_SIZE(rgb_buf); i++) {
> > > + ret = asus_kbd_set_report(led->hdev, rgb_buf[i], sizeof(rgb_buf[i]));
> > > + if (ret < 0) {
> > > + hid_err(led->hdev, "Asus failed to set RGB: %d\n", ret);
> > > + return;
> > > + }
> > > + }
> > > +}
> > > ret = asus_hid_register_listener(&drvdata->kbd_backlight->listener);
> > > - if (ret < 0) {
> > > - /* No need to have this still around */
> > > - devm_kfree(&hdev->dev, drvdata->kbd_backlight);
> > > + /* Asus-wmi might not be accessible so this is not fatal. */
> > > + if (!ret)
> > > + hid_warn(hdev, "Asus-wmi brightness listener not registered\n");
> >
> > Is the condition correct way around given the message?
>
> You are right.
>
> > Please also note that you don't need to send an update every day or so
> > after minor comments like this. We're in merge window currently which
> > means I likely won't be applying any next material until -rc1 has been
> > released.
>
> If this is 6.16 material I am happy to put a pause on this for the
> next 1-3 weeks.
You don't need to "pause" for the merge window, in some subsystem
there's mandatory pause during merge window but I find that unnecessary.
I know people on pdx86 do review during merge window so no need to wait
when working with patches related to pdx86. Just don't expect patches
get applied during the merge window or right after it (the latter tends to
be the most busiest time of cycle for me) :-).
It's more about the frequency, how often to send a series which is
relatively large. Large number of versions end up just filling inboxes
(and patchwork's pending patches list) and we don't have time to read them
all through so I suggest waiting like 3 days at minimum between versions
when the series is large or complex to give time to go through the series.
This is not a hard rule, so if there are e.g. many significant changes,
feel free to "violate" it in that case.
--
i.
next prev parent reply other threads:[~2025-03-26 10:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 18:45 [PATCH v5 00/11] HID: asus: Add RGB Support to Asus Z13, Ally, unify backlight asus-wmi, and Z13 QOL Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 01/11] HID: asus: refactor init sequence per spec Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 02/11] HID: asus: prevent binding to all HID devices on ROG Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 03/11] HID: asus: add Z13 folio to generic group for multitouch to work Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 04/11] platform/x86: asus-wmi: Add support for multiple kbd RGB handlers Antheas Kapenekakis
2025-03-26 19:54 ` kernel test robot
2025-03-25 18:45 ` [PATCH v5 05/11] HID: asus: listen to the asus-wmi brightness device instead of creating one Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 06/11] platform/x86: asus-wmi: remove unused keyboard backlight quirk Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 07/11] platform/x86: asus-wmi: add keyboard brightness event handler Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 08/11] HID: asus: add support for the asus-wmi brightness handler Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 09/11] HID: asus: add basic RGB support Antheas Kapenekakis
2025-03-26 8:54 ` Ilpo Järvinen
2025-03-26 9:09 ` Antheas Kapenekakis
2025-03-26 10:24 ` Ilpo Järvinen [this message]
2025-03-26 11:00 ` Jiri Kosina
2025-03-30 8:39 ` Antheas Kapenekakis
2025-03-31 8:19 ` Luke D. Jones
2025-03-31 8:35 ` Antheas Kapenekakis
2025-03-25 18:45 ` [PATCH v5 10/11] HID: asus: add RGB support to the ROG Ally units Antheas Kapenekakis
2025-03-30 22:11 ` Luke D. Jones
2025-03-31 7:52 ` Antheas Kapenekakis
2025-04-10 19:39 ` Antheas Kapenekakis
2025-03-25 18:46 ` [PATCH v5 11/11] HID: asus: initialize LED endpoint early for old NKEY keyboards Antheas Kapenekakis
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=43c4dd17-de34-804f-7080-b287ac4a0cac@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bentiss@kernel.org \
--cc=corentin.chary@gmail.com \
--cc=hdegoede@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@antheas.dev \
--cc=luke@ljones.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.