fbd-dev-leds: support for multicolor LEDs
Add support for multicolor LEDs as supported by the kernel. Used by Qualcomm devices such as SHIFT 6mq, OnePlus 6, etc. Documentation: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-class-led-multicolor Co-Developed-by: Dylan Van Assche <me@dylanvanassche.be>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#define LED_BRIGHTNESS_ATTR "brightness"
|
||||
#define LED_MULTI_INTENSITY_ATTR "multi_intensity"
|
||||
#define LED_PATTERN_ATTR "pattern"
|
||||
#define LED_REPEAT_ATTR "repeat"
|
||||
#define LED_TRIGGER_ATTR "trigger"
|
||||
@@ -126,6 +127,9 @@ set_perms (const char *sysfs_path, const char *trigger, const char *gname)
|
||||
if (!set_sysfs_attr_perm (sysfs_path, LED_BRIGHTNESS_ATTR, group->gr_gid))
|
||||
return FALSE;
|
||||
|
||||
// Attribute is optional
|
||||
set_sysfs_attr_perm (sysfs_path, LED_MULTI_INTENSITY_ATTR, group->gr_gid);
|
||||
|
||||
if (!g_strcmp0 (trigger, LED_TRIGGER_PATTERN)) {
|
||||
if (!set_sysfs_attr_perm (sysfs_path, LED_PATTERN_ATTR, group->gr_gid))
|
||||
success = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user