Adding support for controlling the leds found on Intel NUC
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest17 patches 32 repliesIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | docs: describe the API used to set NUC LEDsDocumentation/ Documentation/ | +448 | 0 replies | |
| 2/17 | leds: add support for NUC WMI LEDsMAINTAINERS drivers/ drivers/ +1 more | +497 | 0 replies | |
| 3/17 | leds: leds-nuc: detect WMI API detectiondrivers/ | +30 | 0 replies | |
| 4/17 | leds: leds-nuc: add support for changing S0 brightnessdrivers/ | +79 | 0 replies | |
| 5/17 | leds: leds-nuc: add all types of brightnessdrivers/ | +249 | 0 replies | |
| 6/17 | leds: leds-nuc: allow changing the LED colorsdrivers/ | +228 | 6 replies | |
| 7/17 | leds: leds-nuc: add support for WMI API version 1.0drivers/ | +99 | 0 replies | |
| 8/17 | leds: leds-nuc: add basic support for NUC6 WMIdrivers/ | +110 | 0 replies | |
| 9/17 | leds: leds-nuc: add brightness and color for NUC6 APIdrivers/ | +191 | 0 replies | |
| 10/17 | leds: leds-nuc: Add support to blink behavior for NUC8/10drivers/ | +322 | 2 replies | |
| 11/17 | leds: leds-nuc: get rid of an unused variabledrivers/ | +1 | 0 replies | |
| 12/17 | leds: leds-nuc: implement blink control for NUC6drivers/ | +267 | 0 replies | |
| 13/17 | leds: leds-nuc: better detect NUC6/NUC7 devicesdrivers/ | +15 | 0 replies | |
| 14/17 | leds: leds-nuc: add support for HDD activity defaultdrivers/ | +77 | 0 replies | |
| 15/17 | leds: leds-nuc: fix software blink behavior logicdrivers/ | +12 | 0 replies | |
| 16/17 | leds: leds-nuc: add support for changing the ethernet type indicatordrivers/ | +89 | 16 replies | |
| 17/17 | leds: leds-nuc: add support for changing the power limit schemedrivers/ | +93 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/17] Adding support for controlling the leds found on Intel NUC
This series add support for the LEDs found at Intel NUCs since NUC version 6.
On several NUC models, the function of the LEDs are controlled by the NUC firmware and are programmable, which allow them to indicate several different hardware events.
They can also be programmed to represent an userspace-driven event.
Some models come with single colored or dual-colored LEDs, but high end models have RGB LEDs.
Programming them can ether be done via BIOS or by the OS, however, BIOS settings are limited. So, the vendor offers a Windows application that allows to fully use the functionality provided by the firmware/hardware.
It should be noticed that there are 3 different API types, and there are already some OOT drivers that were written to support them, using procfs, each one using a different (and IMO confusing) API.
After looking at the existing drivers and not liking the uAPI interfaces there, and needed to ajust the LEDs again after BIOS config reset, as this is a recommended procedure after BIOS upgrades, I opted to write a new driver from scratch, unifying support for all different versions and using sysfs via the leds class.
It should be noticed that those devices use the ACPI Windows Management Interface (WMI). There are actually 3 different implementations for it:
- one for NUC6/NUC7, which has limited support for programming just two LEDs;
- a complely re-written interface for NUC8, which can program up to seven LEDs, named version 0.64;
- an extended version of the NUC8 API, added for NUC10, called version 1.0, with has a few differences from version 0.64.
Such WMI APIs are documented at:
- https://www.intel.com/content/www/us/en/support/articles/000023426/intel-nuc/intel-nuc-kits.html
- https://raw.githubusercontent.com/nomego/intel_nuc_led/master/specs/INTEL_WMI_LED_0.64.pdf
- https://www.intel.com/content/dam/support/us/en/documents/intel-nuc/WMI-Spec-Intel-NUC-NUC10ixFNx.pdf
It should be noticed that, I wrote this driver mainly for my NUC8 (NUC8i7HNK), but I also used a NUC6 in order to double-check if NUC6 support was not crashing. Yet, while the NUC6 model I have accepts the WMI LED API, it doesn't really work, as it seems that the BIOS of my NUC6 doesn't let userspace to program the LEDs.
I don't have any devices using NUC10 API, so the few differences between it and NUC8 API weren't tested.
Due to the lack of full tests on NUC6 and NUC10, and because I wrote a new uAPI that's different than the procfs-based ones found at the OOT drivers, IMO, the better would be to merge this via staging, but as Greg's feedback were to apply it directly under drivers/leds, this version was changed considering such premise.
PS. : after having the series accepted, I'll submit an extra patch for Documentation/ABI, summarizing the ABI documentation found on patch 01.
-
- v2:
- Added an ABI documentation at patch 01 and dropped the TODO;
- Removed the .remove function, as it was just printing a message;
- Add a check for a return code, as suggested by Dan Carpenter;
- Did some code cleanups as also suggested by Dan Carpenter;
- Changed the Kconfig description as suggested by Randy Dunlap.
Mauro Carvalho Chehab (17):
docs: describe the API used to set NUC LEDs
leds: add support for NUC WMI LEDs
leds: leds-nuc: detect WMI API detection
leds: leds-nuc: add support for changing S0 brightness
leds: leds-nuc: add all types of brightness
leds: leds-nuc: allow changing the LED colors
leds: leds-nuc: add support for WMI API version 1.0
leds: leds-nuc: add basic support for NUC6 WMI
leds: leds-nuc: add brightness and color for NUC6 API
leds: leds-nuc: Add support to blink behavior for NUC8/10
leds: leds-nuc: get rid of an unused variable
leds: leds-nuc: implement blink control for NUC6
leds: leds-nuc: better detect NUC6/NUC7 devices
leds: leds-nuc: add support for HDD activity default
leds: leds-nuc: fix software blink behavior logic
leds: leds-nuc: add support for changing the ethernet type indicator
leds: leds-nuc: add support for changing the power limit scheme
Documentation/leds/index.rst | 1 + Documentation/leds/leds-nuc.rst | 447 +++++++ MAINTAINERS | 7 + drivers/leds/Kconfig | 8 + drivers/leds/Makefile | 1 + drivers/leds/leds-nuc.c | 2097 +++++++++++++++++++++++++++++++ 6 files changed, 2561 insertions(+) create mode 100644 Documentation/leds/leds-nuc.rst create mode 100644 drivers/leds/leds-nuc.c
Signature · 1 line
2.31.1