devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>
Cc: "openwrt-devel@lists.openwrt.org" <openwrt-devel@lists.openwrt.org>
Subject: Describing LEDs roles in device tree?
Date: Mon, 20 Nov 2023 10:54:19 +0100	[thread overview]
Message-ID: <ee912a89-4fd7-43c3-a79b-16659a035fe1@gmail.com> (raw)

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

                 reply	other threads:[~2023-11-20  9:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ee912a89-4fd7-43c3-a79b-16659a035fe1@gmail.com \
    --to=zajec5@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=openwrt-devel@lists.openwrt.org \
    /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).