feat(aura): support Dynamic Lighting sysfs interface with hidraw fallback - #369
Draft
scardracs wants to merge 7 commits into
Draft
feat(aura): support Dynamic Lighting sysfs interface with hidraw fallback#369scardracs wants to merge 7 commits into
scardracs wants to merge 7 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
scardracs
force-pushed
the
leds/dynamic-lighting
branch
4 times, most recently
from
September 12, 2026 17:03
e46e640 to
9474c38
Compare
Replace the manual element-wise loop with slice::fill to address the clippy::manual_slice_fill lint when mutating matrix rows.
scardracs
force-pushed
the
leds/dynamic-lighting
branch
from
September 12, 2026 17:17
9474c38 to
6152969
Compare
Introduce a validated wrapper for Linux Dynamic Lighting LED nodes. Require generic mandatory attributes, probe optional capabilities, and validate ranges, palette capacity, exact buffers, and sysfs errors. Map missing sysfs attributes on numeric writes to AttrNotFound. Keep ASUS aura_mode separate from generic node validation. The unused optional frame sink remains deliberately unexposed. Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Add mapping functions between ROG Aura structures and Dynamic Lighting class values:
- AuraModeNum::{to_dynamic_effect_str, from_dynamic_effect_str}
- Speed::{to_dynamic_speed, from_dynamic_speed}
- Direction::{to_dynamic_direction_str, from_dynamic_direction_str}
- AuraEffect::to_dynamic_palette for extracting RGB palette tuples
- LedBrightness::{to_scaled, from_scaled} for mapping Off/Low/Med/High onto
Dynamic Lighting 0..=max_brightness sysfs ranges
Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Prioritize valid Dynamic Lighting sysfs nodes for laptop Aura control and keep hidraw only as a capability-based fallback when no DL node exists. The two paths stay mutually exclusive for one device. Clean up dead hidraw/comment leftovers in anime and device handles, stream exact led_count*3 RGB payloads through direct_buffer, and honour ASUS aura_mode topology: skip -EBUSY on inactive unified/split nodes, map legacy Key1–4 / bar zones onto keyboard/lightbar nodes, and scale Fn-key brightness across writable DL nodes. Document the userspace DL vs hidraw policy. Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Update DynamicLed device discovery to support non-aura-prefixed LED class nodes that expose the Dynamic Lighting sysfs ABI (effect_index), such as asus::kbd_backlight registered by asus-wmi on TUF laptops. In DeviceHandle::maybe_laptop_aura, fall back to asus::kbd_backlight if aura:keyboard is absent. This allows TUF RGB laptop keyboards to be driven via the unified Dynamic Lighting sysfs path (effect, speed, palette) with graceful fallback to legacy platform sysfs when Dynamic Lighting is not supported by the kernel. Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Drive Slash lighting through the kernel LED classdev sysfs path when asus::slash exists. Do not gate on DMI board lists. Kernel Slash LED has no power_states, so boot/sleep/shutdown/battery/lid D-Bus setters return NotSupported instead of persisting a hardware no-op. Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Match ROG NVMe enclosures to their exact Aura SCSI Dynamic Lighting nodes, retry briefly during registration, and remove the public rog-scsi SG_IO path so vendor commands stay kernel-owned. Also finish hotplug identity, stale-object cleanup, and power_states MissingFunction handling on the shared Aura device manager/types. Signed-off-by: Marco Scardovi <scardracs@disroot.org>
scardracs
force-pushed
the
leds/dynamic-lighting
branch
from
September 13, 2026 10:23
446d581 to
cbbe60a
Compare
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.
Description
This draft introduces support for the Linux kernel Dynamic Lighting LED class interface (
/sys/class/leds/aura:*) acrossasusctl, prioritizing the standardized sysfs interface while maintaining seamless fallback to legacy USBhidrawfor backward compatibility with older kernels. It is based on that draft and as such NOT suitable for daily usage.NOTE: due to heavy work on both here and linux the text on that OP can or cannot be accurate
Key Changes:
rog-platform(DynamicLed):DynamicLedsysfs abstraction for interacting with/sys/class/leds/<device>/.effect,effect_index,speed,speed_range,direction,direction_index,effects_palette(#RRGGBBformat),direct_buffer,brightness, andpower_states.rog-aura:AuraModeNum,Speed,Direction,AuraEffect) and Dynamic Lighting sysfs strings/palettes.asusd(3-Device Multi-Zone Dynamic Lighting & Fallback):aura:global,aura:keyboard, andaura:lightbarduring Aura laptop initialization.AuraZone::None) route toaura:global(firmwareAURA_ZONE_ALL) for atomic aggregate updates across all zones.AuraZone::Key1..4) route toaura:keyboardwithout interrupting lightbar animations.AuraZone::BarLeft/BarRight) route toaura:lightbarwithout disturbing keyboard lighting.hidrawhandle and transparently falls back to direct HID reports if Dynamic Lighting is unsupported on older kernels.maybe_anime_hid.asusctl:clippy::manual_slice_fillinexamples/anime-diag.rs.Tested Hardware & Environment
Verification and testing:
cargo fmt --all -- --check)cargo clippy --all -- -D warnings/cargo check --all-targets)cargo test --all)cargo cranky)