Commit Graph
6 Commits
Author SHA1 Message Date
Dang Huynh f2e59a4ee0 fbd-ledctrl: Add null pointer check for groups
The set_perms function does not check if getgrnam returns a null
pointer.

This causes the fbd-ledctrl to crash when a non-existent group is
passed.
2024-11-16 21:35:40 +01:00
Dylan Van Assche 63b564494b fbd-ledctrl: Set permissions for hw_pattern
Allow access to hw_pattern sysfs node for feedbackd, similar to other nodes.
2024-06-09 11:21:20 +02:00
Luca Weiss e16202eeb5 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>
2022-05-17 20:04:23 +02:00
Clayton Craft 2674654c39 fbd-ledctrl: fix matching of trigger in list of triggers
If the trigger is the last thing in sysfs_path/LED_TRIGGER_ATTR, then
the new-line at the end of the output causes g_strv_contains to fail to
find the trigger in the list. This strips the new-line before splitting
the output into a list for searching.

You can see the problem this patch fixes with the librem 5, by:

$ rmmod ledtrig-timer     # or whatever is listed at the end, so 'pattern' is the last thing
$ cat /sys/devices/platform/pwmleds/leds/blue:status/trigger
[none] kbd-scrolllock ... pattern
$ fbd-ledctrl -p /sys/devices/platform/pwmleds/leds/blue:status -t pattern
Failed to set perms of /sys/devices/platform/pwmleds/leds/blue:status/pattern to 101: No such file or directory
$ modprobe ledtrig-timer
$ cat /sys/devices/platform/pwmleds/leds/blue:status/trigger
[none] kbd-scrolllock ... pattern timer
$ fbd-ledctrl -p /sys/devices/platform/pwmleds/leds/blue:status -t pattern
<success>
2021-03-20 00:26:24 -07:00
Arnaud Ferraris 24956d7208 fbd-ledctrl: fix typo 2020-07-12 16:57:19 +02:00
Guido Günther b561114800 feedbackd: Add helper to set up permissions for LEDs
This helper knows about the tiggers and necessary permission.
It's intended to be run via udev.
2020-07-05 19:25:44 +00:00