mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaron Erhardt <aer@tuxedocomputers.com>
To: "Werner Sembach" <wse@tuxedocomputers.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	 Aaron Erhardt <aer@tuxedocomputers.com>
Subject: [PATCH] platform/x86/tuxedo: Handle LampUpdateFlags in LampRangeUpdateReport
Date: Thu, 29 Oct 2026 11:11:51 +0100	[thread overview]
Message-ID: <20261029-nb04-fixes-v1-1-614da83bd60f@tuxedocomputers.com> (raw)

According to HID Usage Tables v1.7 "Lighting And Illumination Page", the
LampUpdateComplete flag marks an update report as the last of a batch. A
device must apply all prior changes at once when it receives a report
with this flag set.

The handler for LampMultiUpdateReport already honors LampUpdateFlags,
but the handler for LampRangeUpdateReport did not. It always set
LampUpdateComplete on the final chunk, so every range update flushed the
internal color state regardless of what the host requested. This reduced
efficiency and caused unwanted intermediate states for software that
batches updates using the flag.

While splitting the update into several LampMultiUpdateReports, forward
the flags from the range report on the final chunk. Intermediate chunks
continue to carry no flags.

Fixes: cfd84b3f419b ("platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 devices")
Cc: stable@vger.kernel.org
Signed-off-by: Aaron Erhardt <aer@tuxedocomputers.com>
---
Tested userspace software:
- OpenRGB (aac7e55114)
- lampctl (https://github.com/tuxedo-aer/lampctl 5da2aff)
---
 drivers/platform/x86/tuxedo/nb04/wmi_ab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/tuxedo/nb04/wmi_ab.c b/drivers/platform/x86/tuxedo/nb04/wmi_ab.c
index 3e5ba524fe58..300af12e5f8a 100644
--- a/drivers/platform/x86/tuxedo/nb04/wmi_ab.c
+++ b/drivers/platform/x86/tuxedo/nb04/wmi_ab.c
@@ -724,7 +724,7 @@ static int handle_lamp_range_update_report(struct hid_device *hdev,
 		lamp_multi_update_report.lamp_update_flags =
 			i + LAMP_MULTI_UPDATE_REPORT_LAMP_COUNT_MAX >=
 			rep->lamp_id_end + 1 ?
-				LAMP_UPDATE_FLAGS_LAMP_UPDATE_COMPLETE : 0;
+				rep->lamp_update_flags : 0;
 
 		for (unsigned int j = 0; j < lamp_multi_update_report.lamp_count; ++j) {
 			lamp_multi_update_report.lamp_id[j] = i + j;

---
base-commit: c166bec9343c8b50e4c2acb78b1424c23d98841f
change-id: 20261028-nb04-fixes-6d5dab6989aa

Best regards,
--  
Aaron Erhardt <aer@tuxedocomputers.com>


                 reply	other threads:[~2026-10-29 10:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261029-nb04-fixes-v1-1-614da83bd60f@tuxedocomputers.com \
    --to=aer@tuxedocomputers.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=wse@tuxedocomputers.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

all inboxes | Powered by JetHome®