summaryrefslogtreecommitdiffstats
path: root/Documentation/leds/leds-class.txt
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-20 17:31:23 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-20 17:31:23 -0800
commit7aa7d608112baf63a0b1278955f9619427373807 (patch)
treeb6a7ed4233ddf3a6760bd72aed93d4b83b1f7c45 /Documentation/leds/leds-class.txt
parent85adbcd54f0982040c8cc7a086f01554b8f64427 (diff)
parentfb3d769173d26268d7bf068094a599bb28b2ac63 (diff)
downloadlinux-7aa7d608112baf63a0b1278955f9619427373807.tar.bz2
Merge tag 'leds_for_4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
Pull LED updates from Jacek Anaszewski: "New features and improvements: - add new optional brightness_hw_changed attribute for the LEDs that may have their brightness level changed autonomously (outside of kernel control) by hardware / firmware. The attribute supports userspace notifications through POLLPRI events - add led_brightness_hw_mon tool that demonstrates how to use the aforementioned feature - add LED_ON enum for LEDs that can be only turned on/off, and don't allow setting other brightness levels - allow for adjusting heartbeat trigger blink brightness level Fixes and cleanups: - avoid harmless maybe-uninitialized warning in leds-ktd2692.c - add context to the existing example entries in common LED bindings to make the documentation more clear" * tag 'leds_for_4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: leds: ledtrig-heartbeat: Make top brightness adjustable tools/leds: Add led_hw_brightness_mon program leds: class: Add new optional brightness_hw_changed attribute leds: ktd2692: avoid harmless maybe-uninitialized warning leds: add LED_ON brightness as boolean value DT: leds: Improve examples by adding some context
Diffstat (limited to 'Documentation/leds/leds-class.txt')
-rw-r--r--Documentation/leds/leds-class.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/leds/leds-class.txt b/Documentation/leds/leds-class.txt
index f1f7ec9f5cc5..836cb16d6f09 100644
--- a/Documentation/leds/leds-class.txt
+++ b/Documentation/leds/leds-class.txt
@@ -65,6 +65,21 @@ LED subsystem core exposes following API for setting brightness:
blinking, returns -EBUSY if software blink fallback is enabled.
+LED registration API
+====================
+
+A driver wanting to register a LED classdev for use by other drivers /
+userspace needs to allocate and fill a led_classdev struct and then call
+[devm_]led_classdev_register. If the non devm version is used the driver
+must call led_classdev_unregister from its remove function before
+free-ing the led_classdev struct.
+
+If the driver can detect hardware initiated brightness changes and thus
+wants to have a brightness_hw_changed attribute then the LED_BRIGHT_HW_CHANGED
+flag must be set in flags before registering. Calling
+led_classdev_notify_brightness_hw_changed on a classdev not registered with
+the LED_BRIGHT_HW_CHANGED flag is a bug and will trigger a WARN_ON.
+
Hardware accelerated blink of LEDs
==================================