mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Josef Schlehofer <pepe.schlehofer@gmail.com>
Cc: "Lee Jones" <lee@kernel.org>, "Pavel Machek" <pavel@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Pali Rohár" <pali@kernel.org>, "Marek Behún" <kabel@kernel.org>,
	"Andy Shevchenko" <andy@kernel.org>, "Rong Zhang" <i@rong.moe>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] leds: Add support for Turris 1.x LEDs
Date: Tue, 29 Sep 2026 16:45:24 +0200	[thread overview]
Message-ID: <arvNDgAVO4V_drW7@solitude> (raw)
In-Reply-To: <20260928111907.72592-3-pepe.schlehofer@gmail.com>

On Mon, Sep 28, 2026 at 01:19:07PM +0200, Josef Schlehofer wrote:

> The five LAN LEDs share one set of colour
> registers, so the colour and brightness set last on any of them apply
> to all five.

...

> +static int turris1x_led_register(struct device *dev, struct turris1x_leds *ddata,
> +				 struct fwnode_handle *fwnode, u8 val_sw_override,

...

> +	cdev->max_brightness = 255;
> +	cdev->brightness_set = turris1x_led_brightness_set;

As described in the commit message, LAN LEDs form a group for which
the colors of individual LEDs cannot be changed.

Setting color for LAN3 LED to green will change colors for all
LAN1..5 LEDs to green.

This proposal does not reflect that in sysfs in any way.

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.

Marek

  parent reply	other threads:[~2026-09-29 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 11:19 [PATCH v3 0/2] leds: Add support for CZ.NIC " Josef Schlehofer
2026-09-28 11:19 ` [PATCH v3 1/2] dt-bindings: leds: Add CZ.NIC Turris 1.x LED controller Josef Schlehofer
2026-09-28 11:19 ` [PATCH v3 2/2] leds: Add support for Turris 1.x LEDs Josef Schlehofer
2026-09-28 13:07   ` Andy Shevchenko
2026-09-29 14:45   ` Marek Behún [this message]
2026-09-29 15:30   ` Uwe Kleine-König

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=arvNDgAVO4V_drW7@solitude \
    --to=kabel@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=i@rong.moe \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=pavel@kernel.org \
    --cc=pepe.schlehofer@gmail.com \
    --cc=robh@kernel.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

all inboxes | Powered by JetHome®