Linux LED subsystem development
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Craig McQueen <craig@mcqueen.au>
Cc: linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 1/1] leds: Introduce userspace LED triggers driver
Date: Tue, 25 Mar 2025 14:15:41 +0100	[thread overview]
Message-ID: <Z+KsfcjvlsxAN2LE@duo.ucw.cz> (raw)
In-Reply-To: <20250311013143.371930-2-craig@mcqueen.au>

[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]

Hi!

> This driver creates a userspace LED triggers driver similar to
> uleds and uinput.
> 
> New LED triggers are created by opening /dev/uledtriggers and writing
> a uledtriggers_user_dev struct. A new LED trigger is registered with the
> name given in the struct.
> 
> After the initial setup, writing an int value will set the trigger's
> brightness, equivalent to calling led_trigger_event().
> 
> Alternatively, there are ioctls for setup, changing trigger brightness,
> or doing blinking.
> 
> Closing the file handle to /dev/uledtriggers will remove the LED
> trigger.

Would you explain some usecases where this is useful?

Userspace can already control the leds using /sys/class/leds...


> +++ b/include/uapi/linux/uledtriggers.h
> +/*
> + * Brightness levels for writes of int values, or for use with ULEDTRIGGERS_IOC_EVENT.
> + * These correspond to Linux kernel internal enum led_brightness in linux/leds.h.
> + */
> +enum uledtriggers_brightness {
> +	ULEDTRIGGERS_OFF		= 0,
> +	ULEDTRIGGERS_ON			= 1,
> +	ULEDTRIGGERS_HALF		= 127,
> +	ULEDTRIGGERS_FULL		= 255,
> +};

We are trying to get rid of brightness half, etc. Userspace can
already make leds blink and use oneshot.

NAK.

Best regards,

								Pavel
-- 
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2025-03-25 13:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11  1:28 [PATCH v2 0/1] Introduce userspace LED triggers driver Craig McQueen
2025-03-11  1:28 ` [PATCH v2 1/1] leds: " Craig McQueen
2025-03-25 13:15   ` Pavel Machek [this message]
2025-03-27  2:13     ` Craig McQueen
2025-04-11 10:08       ` Pavel Machek
2025-03-11  1:57 ` [PATCH v2 0/1] " Craig McQueen
2025-03-14 10:57 ` Lee Jones

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=Z+KsfcjvlsxAN2LE@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=craig@mcqueen.au \
    --cc=linux-leds@vger.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