devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Describing LEDs roles in device tree?
@ 2023-11-20  9:54 Rafał Miłecki
  0 siblings, 0 replies; only message in thread
From: Rafał Miłecki @ 2023-11-20  9:54 UTC (permalink / raw)
  To: devicetree@vger.kernel.org, linux-leds@vger.kernel.org
  Cc: openwrt-devel@lists.openwrt.org

Hi!

Our current binding Documentation/devicetree/bindings/leds/common.yaml
allows describing some generic LED parameters. Most common are color and
function.

Now, many systems will want further & more specialized description of
LEDs. Most common roles I can think of:
1. System is booting
2. System is running
3. System's failure

For kernel usage role we actually have a "panic-indicator" property.

Are those extra roles something we could put in DT?

Please note that "function" on its own is not sufficient as multiple
LEDs my share the same function name but its meaning may vary depending
on color.

OpenWrt developers started (ab?)using aliases in downstream/modified DT
files for such purposes. Example:

aliases {
	led-boot = &led_status_blue;
	led-running = &led_status_green;
	led-failsafe = &led_status_red;
};

Above could work with some adjustments but I'm not sure if it's
acceptable for upstream binding. Also what if OpenWrt wants to define
different roles than another project? Prefixes?

With Linux a problem is also a lack of mapping between
/proc/device-tree/leds/*
and
/sys/class/leds/*
With "label" present its simple but some guessing logic is needed for
function + color properties (it's actually missing in OpenWrt right now)

Any suggestions for DT-based solution?

-- 
Rafał Miłecki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-20  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20  9:54 Describing LEDs roles in device tree? Rafał Miłecki

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).