forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'leds_for_4.10' of git://git.kernel.org/pub/scm/linux/kerne…
…l/git/j.anaszewski/linux-leds Pull LED updates from Jacek Anaszewski: - userspace LED class driver - it can be useful for testing triggers and can also be used to implement virtual LEDs - LED class driver for NIC78bx device - LED core fixes for preventing potential races while setting brightness when software blinking is enabled - improvements in LED documentation to mention semantics on changing brightness while trigger is active * tag 'leds_for_4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: leds: pca955x: Add ACPI support leds: netxbig: fix module autoload for OF registration leds: pca963x: Add ACPI support leds: leds-cobalt-raq: use builtin_platform_driver led: core: Fix blink_brightness setting race led: core: Use atomic bit-field for the blink-flags leds: Add user LED driver for NIC78bx device leds: verify vendor and change license in mlxcpld driver leds: pca963x: enable low-power state leds: pca9532: Use default trigger value from platform data leds: pca963x: workaround group blink scaling issue cleanup LED documentation and make it match reality leds: lp3952: Export I2C module alias information for module autoload leds: mc13783: Fix MC13892 keypad led access ledtrig-cpu.c: fix english leds/leds-lp5523.txt: make documentation match reality tools/leds: Add uledmon program for monitoring userspace LEDs leds: Use macro for max device node name size leds: Introduce userspace LED class driver mfd: qcom-pm8xxx: Clean up PM8XXX namespace
- Loading branch information
Showing
32 changed files
with
807 additions
and
107 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,32 @@ KernelVersion: 2.6.17 | |
Contact: Richard Purdie <[email protected]> | ||
Description: | ||
Set the brightness of the LED. Most LEDs don't | ||
have hardware brightness support so will just be turned on for | ||
have hardware brightness support, so will just be turned on for | ||
non-zero brightness settings. The value is between 0 and | ||
/sys/class/leds/<led>/max_brightness. | ||
|
||
Writing 0 to this file clears active trigger. | ||
|
||
Writing non-zero to this file while trigger is active changes the | ||
top brightness trigger is going to use. | ||
|
||
What: /sys/class/leds/<led>/max_brightness | ||
Date: March 2006 | ||
KernelVersion: 2.6.17 | ||
Contact: Richard Purdie <[email protected]> | ||
Description: | ||
Maximum brightness level for this led, default is 255 (LED_FULL). | ||
Maximum brightness level for this LED, default is 255 (LED_FULL). | ||
|
||
If the LED does not support different brightness levels, this | ||
should be 1. | ||
|
||
What: /sys/class/leds/<led>/trigger | ||
Date: March 2006 | ||
KernelVersion: 2.6.17 | ||
Contact: Richard Purdie <[email protected]> | ||
Description: | ||
Set the trigger for this LED. A trigger is a kernel based source | ||
of led events. | ||
of LED events. | ||
You can change triggers in a similar manner to the way an IO | ||
scheduler is chosen. Trigger specific parameters can appear in | ||
/sys/class/leds/<led> once a given trigger is selected. For | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Userspace LEDs | ||
============== | ||
|
||
The uleds driver supports userspace LEDs. This can be useful for testing | ||
triggers and can also be used to implement virtual LEDs. | ||
|
||
|
||
Usage | ||
===== | ||
|
||
When the driver is loaded, a character device is created at /dev/uleds. To | ||
create a new LED class device, open /dev/uleds and write a uleds_user_dev | ||
structure to it (found in kernel public header file linux/uleds.h). | ||
|
||
#define LED_MAX_NAME_SIZE 64 | ||
|
||
struct uleds_user_dev { | ||
char name[LED_MAX_NAME_SIZE]; | ||
}; | ||
|
||
A new LED class device will be created with the name given. The name can be | ||
any valid sysfs device node name, but consider using the LED class naming | ||
convention of "devicename:color:function". | ||
|
||
The current brightness is found by reading a single byte from the character | ||
device. Values are unsigned: 0 to 255. Reading will block until the brightness | ||
changes. The device node can also be polled to notify when the brightness value | ||
changes. | ||
|
||
The LED class device will be removed when the open file handle to /dev/uleds | ||
is closed. | ||
|
||
Multiple LED class devices are created by opening additional file handles to | ||
/dev/uleds. | ||
|
||
See tools/leds/uledmon.c for an example userspace program. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,6 +400,9 @@ static int __init mlxcpld_led_init(void) | |
struct platform_device *pdev; | ||
int err; | ||
|
||
if (!dmi_match(DMI_CHASSIS_VENDOR, "Mellanox Technologies Ltd.")) | ||
return -ENODEV; | ||
|
||
pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0); | ||
if (IS_ERR(pdev)) { | ||
pr_err("Device allocation failed\n"); | ||
|
@@ -426,5 +429,5 @@ module_exit(mlxcpld_led_exit); | |
|
||
MODULE_AUTHOR("Vadim Pasternak <[email protected]>"); | ||
MODULE_DESCRIPTION("Mellanox board LED driver"); | ||
MODULE_LICENSE("GPL v2"); | ||
MODULE_LICENSE("Dual BSD/GPL"); | ||
MODULE_ALIAS("platform:leds_mlxcpld"); |
Oops, something went wrong.