Leds/dynamic lighting - #17
Draft
scardracs wants to merge 4 commits into
Draft
Conversation
scardracs
force-pushed
the
leds/dynamic-lighting
branch
2 times, most recently
from
September 4, 2026 19:51
b472da2 to
02c6e54
Compare
Define LED_DYNAMIC_LIGHTING flag in struct led_classdev to enable runtime type identification for Dynamic Lighting class devices, matching the established pattern used by LED_MULTI_COLOR. Signed-off-by: Marco Scardovi <[email protected]>
scardracs
force-pushed
the
leds/dynamic-lighting
branch
2 times, most recently
from
September 5, 2026 12:09
005fb1f to
c6ee973
Compare
NeroReflex
reviewed
Sep 5, 2026
| #include <linux/string.h> | ||
| #include <linux/sysfs.h> | ||
|
|
||
| static const char * const dl_zone_type_names[] = { |
Collaborator
There was a problem hiding this comment.
These have to be managed by the specific driver (like hid-asus).
the dynamic lighting will need to be fully agnostic about what It's supported. Something like drm core that is made of helpers
Add the Dynamic Lighting LED class subsystem to provide a standardized,
sysfs-native interface for complex illumination devices such as per-key
RGB keyboard matrices, 2D LED displays, addressable segment strips, and
chassis lightbars.
Introduce struct led_classdev_dynamic which wraps struct led_classdev
and provides:
- Static sysfs attribute groups with dynamic visibility helpers to
prevent race conditions during device registration.
- Sysfs metadata attributes ('led_count', 'matrix_dimensions') enabling
dynamic userspace frame buffer sizing without hardcoded quirk tables.
- Hardware animation effect management ('effect', 'effects_supported',
'effect_speed', 'effect_direction') and multi-color stacked palettes
('effects_palette') using bounds-checked hex2bin parsing.
- Platform power state persistence ('power_states_supported',
'power_states') for hardware states (boot, awake, sleep, shutdown).
- High-throughput binary frame sinks ('direct_buffer', 'frame') for
60 FPS RGB matrix streaming and monochrome chunk transfers.
- Strict lock hierarchy (cdev->led_access > trigger removal >
ldev->lock) preventing deadlocks between sysfs handlers and LED
triggers.
- Scope-based guard(mutex) resource acquisition across all sysfs handlers.
- Runtime class identification via is_dynamic_lighting_led() helper.
Signed-off-by: Marco Scardovi <[email protected]>
Add documentation for the Dynamic Lighting LED class interface: - Documentation/ABI/testing/sysfs-class-leds-dynamic: version-agnostic sysfs and binary attribute interface specification. - Documentation/leds/leds-class-dynamic.rst: overview of topology types, sysfs directory layout, attribute details, locking order, and interaction examples. - Register leds-class-dynamic in Documentation/leds/index.rst. - Track documentation files under LED DYNAMIC LIGHTING CLASS in MAINTAINERS. Signed-off-by: Marco Scardovi <[email protected]>
…ming Add native Dynamic Lighting class support to hid-asus for ASUS ROG keyboards and chassis lightbars using the Aura USB HID wire protocol: - Discover Aura lighting capabilities and zone layout (4-Zone vs Per-Key) via Report 0x5D opcode 0x05 (0x05 0x20 0x31) querying hardware layout and feature flags (lightbar presence). - Wake all physical hardware zones (zones 0..3 for keyboard, zone 4 for chassis lightbar) via asus_aura_wake_all_zones() with power gating unmute (report 0x5d 0xbd) and error propagation. - Implement hardware animation effect configuration (report 0x5d 0xb3) for keyboard zones (zones 1..4, or zone 0 All) and chassis lightbar zones (zone 6 BarLeft and zone 7 BarRight). - Sequence commit operations using the staging SET command (0x5d 0xb5) followed by the APPLY command (0x5d 0xb4) for keyboard zones to reliably activate and persist hardware register state in alignment with Armoury Crate and asusctl captures, while omitting commit on the lightbar path where updates apply immediately. - Maintain independent per-channel direct streaming state (kbd_direct_mode and lightbar_direct_mode) and provide independent effect, speed, direction, brightness, and color control across 'aura:keyboard' and 'aura:lightbar' dynamic lighting devices. - Route lightbar animated effects strictly through opcode 0xb3 without trailing direct streaming packets, reserving direct packets on channel 0x04 for static/off modes and direct buffer writes. - Implement direct RGB streaming for ASUS ROG Strix series laptops sharing USB PID 0b05:19b6 (e.g. G614, G834 models) via asus_aura_strix_set_direct() and asus_aura_lightbar_set_direct() using 64-byte HID Feature Reports with opcode 0xbc on channels 0x01 and 0x04. - Correct 4-zone chassis lightbar direct buffer bounds (18 bytes at offset 27) and enforce exact led_count * 3 buffer size validation across direct write callbacks. - Bound direct per-key keyboard frame transmissions strictly to 11 packets carrying 168 LEDs total (504 bytes), preventing the internal firmware defect where a 12th packet shuts off the rear lightbar and front glow strip. - Serialize Aura feature and raw requests with guard(mutex)(&drvdata->aura_lock) and manage lock and DMA buffer lifetime with devm_mutex_init and devm_kzalloc. - Register 'aura:keyboard' and 'aura:lightbar' dynamic lighting devices during probe prior to the QUIRK_ROG_NKEY_KEYBOARD early return, leaving legacy 'asus::kbd_backlight' 4-step brightness fully functional without regressions. Signed-off-by: Marco Scardovi <[email protected]>
scardracs
force-pushed
the
leds/dynamic-lighting
branch
from
September 5, 2026 14:23
c6ee973 to
2ce82cc
Compare
Author
|
I've moved the patch to 7.2 in order to have some stability (7.3 is way too bugged as for now). When the situation will be better I'll move it back to 7.3. I leave that draft open for now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft for progress. I'll make a proper PR title/message when it is ready for review.