Skip to content

asus-wmi: Add support for RGB keyboards

Luke D. Jones lkml platform-driver-x86 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 4 repliesIn review
  2. v36 patches 26 repliesSuperseded
  3. v26 patches 12 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches24 repliesSuperseded

Changelog from the cover letter · 35 lines

- V4:
+ Reimplement an version of the patch with attributes for control.
+ Add the control attributes as a group under asus::kbd_backlight
+ Rebased on review-hans
- V3: patch 2: asus-wmi RGB mode control
+ Split save, speed, mode in to separate nodes
+ Remove the _index node as it is not required with the above nodes
+ Cleanup of a one-line ternary
+ rename asus->keyboard_rgb_mode to keyboard_rgb_led to be clearer about purpose
+ Attach documentation to this patch
- V3: patch 3:
+ Use BIT() in place of previous hex for flags
+ Comment on purpose of 0xbd in state write
+ Attach documentation to this patch
- V3: patch 6: asus-wmi: hardware GPU MUX:
+ Include the correct patch for this feature
- V2: patch 1: asus-wmi - RGB
+ shorten a few lines
+ move unused keyboard_rgb_mode_available to next patch
+ remove tuf_rgb_brightness_get() is it was only returning current led_classdev brightness, not reading it from device
+ remove unnecessary setting of brightness on multicolor init
+ set brightness_get to null for TUF RGB
+ actually use the member subled_info in keyboard_rgb_led struct and not the leftover dynamic allocation (now removed)
- V2: patch 2: asus-wmi RGB mode control
+ tuf_rgb_brightness_set() was still using hardcoded save/mode/speed from testing. This is now using the pre-set default.
+ asus_wmi_led_init(), set speed value to a correct value
+ keyboard_rgb_mode_store() return count, not 0
+ correctly unregister the mulicolor led on module exit
+ use switch/case in keyboard_rgb_mode_store() for speed
+ remove a single line bracket block
- V2: patch 3: asus-wmi RGB power control
+ Try to fix the indent warning from buildbot
+ Use correct date on added API docs
+ Add missing panel_od doc
+ correctly label attribute for keyboard_rgb_state

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2asus-wmi: Implement TUF laptop keyboard LED modesdrivers/platform/x86/asus-wmi.c include/linux/platform_data/x86/asus-wmi.h+78 -14 replies
2/2asus-wmi: Implement TUF laptop keyboard power statesdrivers/platform/x86/asus-wmi.c include/linux/platform_data/x86/asus-wmi.h+60 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/2] asus-wmi: Add support for RGB keyboards

This is a patch series to add RGB support for ASUS laptops. The laptops with this RGB tend to be the TUF series of gamer laptops.

These types of keyboards implement a slightly more complex interface than just RGB control - they also have modes with can be static LED, blinking, rainbow, color cycles, and more. They also have some custom animations that can play depending on device state, such as suspended playing a fancy colour cycle, or playing a "wave" animation.

Two of the patches add support for these features.

It should be noted that these patches progressed from an initial version much like the one here, to an implementation using the multicolor RGB class that is available. This class was found to be unsuitable after testing actual use because these keyboards provide a asus::kbd_backlight backlight control which is 4-step, and completely turns off LEDs, alongside the fact that some laptops boot with LEDs off by default, making multicolor invisible.

The added attributes for RGB control are added to attr groups under asus::kbd_backlight.

Previous discussion regarding the above can be found here:
https://lore.kernel.org/platform-driver-x86/[email protected]/

Changelog:
- V4:
+ Reimplement an version of the patch with attributes for control.
+ Add the control attributes as a group under asus::kbd_backlight
+ Rebased on review-hans
- V3: patch 2: asus-wmi RGB mode control
+ Split save, speed, mode in to separate nodes
+ Remove the _index node as it is not required with the above nodes
+ Cleanup of a one-line ternary
+ rename asus->keyboard_rgb_mode to keyboard_rgb_led to be clearer about purpose
+ Attach documentation to this patch
- V3: patch 3:
+ Use BIT() in place of previous hex for flags
+ Comment on purpose of 0xbd in state write
+ Attach documentation to this patch
- V3: patch 6: asus-wmi: hardware GPU MUX:
+ Include the correct patch for this feature
- V2: patch 1: asus-wmi - RGB
+ shorten a few lines
+ move unused keyboard_rgb_mode_available to next patch
+ remove tuf_rgb_brightness_get() is it was only returning current led_classdev brightness, not reading it from device
+ remove unnecessary setting of brightness on multicolor init
+ set brightness_get to null for TUF RGB
+ actually use the member subled_info in keyboard_rgb_led struct and not the leftover dynamic allocation (now removed)
- V2: patch 2: asus-wmi RGB mode control
+ tuf_rgb_brightness_set() was still using hardcoded save/mode/speed from testing. This is now using the pre-set default.
+ asus_wmi_led_init(), set speed value to a correct value
+ keyboard_rgb_mode_store() return count, not 0
+ correctly unregister the mulicolor led on module exit
+ use switch/case in keyboard_rgb_mode_store() for speed
+ remove a single line bracket block
- V2: patch 3: asus-wmi RGB power control
+ Try to fix the indent warning from buildbot
+ Use correct date on added API docs
+ Add missing panel_od doc
+ correctly label attribute for keyboard_rgb_state

Luke D. Jones (2):
asus-wmi: Implement TUF laptop keyboard LED modes
asus-wmi: Implement TUF laptop keyboard power states

 drivers/platform/x86/asus-wmi.c            | 157 ++++++++++++++++++++-
 include/linux/platform_data/x86/asus-wmi.h |   6 +
 2 files changed, 162 insertions(+), 1 deletion(-)
Signature · 1 line
2.37.1