From: Jonathan Brophy <professorjonny98@gmail.com>
To: lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Jonathan Brophy <professor_jonny@hotmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Radoslav Tsvetkov <rtsvetkov@gradotech.eu>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org
Subject: [PATCH v2 0/4] leds: Add a virtual LED driver for groups of
Date: Tue, 14 Oct 2025 01:09:44 +1300 [thread overview]
Message-ID: <20251013120955.227572-1-professorjonny98@gmail.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 3803 bytes --]
From: Jonathan Brophy <professor_jonny@hotmail.com>
Introduce a new driver that implements virtual LED groups,
aggregating multiple monochromatic LEDs into virtual groups and providing
priority-based control for concurrent state management.
Existing multi-LED drivers are primarily intended to group monochrome LEDs
into multicolor LEDs, allowing per-channel intensity control of hue and
brightness. However, they are not designed to manage grouped LEDs with
independent functional roles or shared behavior.
The leds-group-virtualcolor driver allows arbitrary LEDs to be grouped
and exposed as a single logical LED representing a fixed color, status, or
function. Properties such as triggers and brightness are applied to the group
as a whole, rather than to individual LED elements.
This is particularly useful in consumer devices (e.g., routers), where a
single status LED must reflect multiple device states via color or blink
patterns. In such cases, simple device tree bindings are insufficient,
as multiple triggers may activate simultaneously, resulting in color mixing
and ambiguous status indication.
To avoid this problem, the driver implements a priority mechanism that allows
higher-priority LEDs to assume control of the group. When multiple LEDs of the
same priority are active concurrently, the most recently activated LED takes
precedence over earlier ones. If a higher-priority LED is extinguished, a lower-
priority LED will become active.
If an LED is set to blink, or is controlled with an on or off delay, any time
the LED is inactive but still triggered, it will be the only LED in control and
will be extinguished during this time for best contrast.
leds-group-virtualcolor can also enable decomposition of multi-element multicolor
LEDs into individual virtual groups that can provide individual virtual color
LEDs, supporting flexible trigger assignments and precise status representation.
leds-group-virtualcolor can also expose a singular LED as multiple virtual LEDs,
each having individual triggers, timings, or other properties.
Additionally, traditional bindings can only control individual LED elements,
making it impossible to represent composite colors formed by combinations
of primary RGB components but this is also made possible.
Originally intended to be used with OpenWrt for controlling RGB status LEDs
so control of power, reboot and system upgrade cam mimic the manufactures status
LED mixed colors.
Often when a device ported to OpenWrt RGB status LEDs usually became a glorified
power-led instead of a status led because user scripts or binaries would have to
be implemented as additional packages to control logic.
leds-group-virtualcolor is designed to allow LED behavior to be
fully described and logically controlled in the device tree, enabling early
status indication during system initialization—without relying on user-space
scripts or custom binaries.
Jonathan Brophy (4):
dt-bindings: leds: Add YAML bindings for Virtual Color LED Group
driver
ABI: sysfs-class-leds-virtualcolor: Document sysfs entries for Virtual
Color LEDs
dt-bindings: led: add virtual LED bindings
leds: Add Virtual Color LED Group driver
.../ABI/sysfs-class-leds-virtualcolor | 43 +
.../leds/leds-group-virtualcolor.yaml | 100 ++
drivers/leds/rgb/Kconfig | 17 +
drivers/leds/rgb/Makefile | 1 +
drivers/leds/rgb/leds-group-virtualcolor.c | 439 +++++++
include/dt-bindings/leds/common.h | 4 +
6 files changed, 604 insertions(+),
create mode 100644 Documentation/ABI/sysfs-class-leds-virtualcolor
create mode 100644 Documentation/devicetree/bindings/leds/leds-group-virtualcolor.yaml
create mode 100644 drivers/leds/rgb/leds-group-virtualcolor.c
--
2.43.0
next reply other threads:[~2025-10-13 12:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 12:09 Jonathan Brophy [this message]
2025-10-13 12:09 ` [PATCH v2 1/4] dt-bindings: leds: Add YAML bindings for Virtual Color LED Group driver Jonathan Brophy
2025-10-13 23:41 ` Krzysztof Kozlowski
2025-10-14 3:08 ` Jonathan Brophy
2025-10-14 8:19 ` Krzysztof Kozlowski
2025-10-14 16:35 ` Rob Herring (Arm)
2025-10-13 12:09 ` [PATCH v2 2/4] ABI: sysfs-class-leds-virtualcolor: Document sysfs Jonathan Brophy
2025-10-13 12:09 ` [PATCH v2 3/4] dt-bindings: led: add virtual LED bindings Jonathan Brophy
2025-10-13 12:09 ` [PATCH v2 4/4] leds: Add Virtual Color LED Group driver Jonathan Brophy
2025-10-13 15:39 ` Thomas Weißschuh
2025-10-23 14:48 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251013120955.227572-1-professorjonny98@gmail.com \
--to=professorjonny98@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=professor_jonny@hotmail.com \
--cc=robh@kernel.org \
--cc=rtsvetkov@gradotech.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).