Re: [PATCH v3 2/2] leds: Add support for Turris 1.x LEDs

From: Josef Schlehofer

Date: Sat Oct 17 2026 - 15:15:44 EST



Hi Marek,

> On 29. 9. 2026, at 16:45, Marek Behún <kabel@xxxxxxxxxx> wrote:
>
> My proposal is to register the first LAN LED as a true multicolor LED,
> and the rest of LAN LEDs as simple LEDs, and then create sysfs
> symlinks for the multi_intensity and multi_index attribute files:
>
> rgb:lan-1
> multi_intensity (true attribute file)
> multi_index (true attribute file)
> rgb:lan-2
> multi_intensity (symlink to ../rgb:lan-1/multi_intensity)
> multi_index (symlink to ../rgb:lan-1/multi_index)
> ...
>
> This way the sysfs will somehow reflect this topology.
>
> Also, the max_brigthness will need to be set to 1 instead of 255,
> since we can set each LAN LED on/off state individually, but color
> globally.

I tried to reach you privately about this. I am ready to do it, but
before I do, I would like to clarify one thing.

v4 will have rgb:lan-1 as the multicolor LED, the other four LAN LEDs
as plain LEDs, and max_brightness 1 on all five.

I am not sure about the symlinks, though. sysfs_create_link() can only
link a whole kobject. A single attribute can be linked with
compat_only_sysfs_link_entry_to_kobj(), but its callers in the tree
(tpm, fadump, img-ascii-lcd) use it to keep old sysfs paths working.
Would you and Lee be fine with it here, or do you prefer a link to the
whole rgb:lan-1 directory, or only the ABI documentation saying that
rgb:lan-1 sets the colour of all five?

Josef