mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: lee@kernel.org, pavel@kernel.org
Cc: corbet@lwn.net, skhan@linuxfoundation.org,
	linux-leds@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, wse@tuxedocomputers.com,
	pobrn@protonmail.com
Subject: [RFC PATCH 0/1] leds: Introduce the multi_max_intensity sysfs attribute
Date: Sun, 15 Mar 2026 00:01:06 +0100	[thread overview]
Message-ID: <20260314230107.65444-1-W_Armin@gmx.de> (raw)

This patch series was born out of of a mailing list thread [1] where
i asked how to properly model a RGB LED as a multicolor LED. Said
LED has some exotic properties:

1. 5 global brightness levels.
2. 50 intensity levels for each R/G/B color components.

The current sysfs interface mandates that the maximum intensity value
for each color component should be the same as the maximum global
brightness. This makes sense for LEDs that only emulate global
brightness using led_mc_calc_color_components(), but causes problems
for LEDs that perform global brightness control in hardware.

Faking a maximum global brightness of 50 will not work in this case,
as the hardware can change the global brightness on its own. Userspace
applications might also prefer to know the true maximum brightness
value.

Because of this i decided to add a new sysfs attribute called
"multi_max_intensity". This attribute is similar to the
"max_brightness" sysfs attribute, except that it targets the intensity
values inside the "multi_intensity" sysfs atribute. I also decided to
cap intensity values comming from userspace to said maximum intensity
values to relieve drivers from doing it themself. This was already
proposed in a unrelated patch [2] and might break some misbehaving
userspace applications that do not respect max_brightness.

[1] https://lore.kernel.org/linux-leds/2d91a44e-fce2-42dc-b529-133ab4a191f0@gmx.de/
[2] https://lore.kernel.org/linux-leds/20260123-leds-multicolor-limit-intensity-v1-1-b37761c2fdfd@pengutronix.de/

Armin Wolf (1):
  leds: Introduce the multi_max_intensity sysfs attribute

 .../ABI/testing/sysfs-class-led-multicolor    | 16 +++++++--
 Documentation/leds/leds-class-multicolor.rst  | 21 ++++++++++-
 drivers/hid/hid-lg-g15.c                      |  3 ++
 drivers/hid/hid-playstation.c                 |  3 ++
 drivers/leds/flash/leds-mt6360.c              |  8 ++---
 drivers/leds/led-class-multicolor.c           | 36 +++++++++++++++++--
 drivers/leds/leds-blinkm.c                    |  3 ++
 drivers/leds/leds-cros_ec.c                   |  1 +
 drivers/leds/leds-lp50xx.c                    |  1 +
 drivers/leds/leds-lp55xx-common.c             |  7 ++--
 drivers/leds/leds-max77705.c                  |  1 +
 drivers/leds/leds-sun50i-a100.c               |  3 ++
 drivers/leds/leds-turris-omnia.c              |  1 +
 drivers/leds/rgb/leds-group-multicolor.c      |  1 +
 drivers/leds/rgb/leds-ktd202x.c               |  1 +
 drivers/leds/rgb/leds-lp5812.c                |  1 +
 drivers/leds/rgb/leds-mt6370-rgb.c            |  8 ++---
 drivers/leds/rgb/leds-ncp5623.c               |  4 +--
 drivers/leds/rgb/leds-pwm-multicolor.c        |  1 +
 drivers/leds/rgb/leds-qcom-lpg.c              |  1 +
 drivers/platform/x86/silicom-platform.c       | 30 ++++++++++++++++
 drivers/platform/x86/uniwill/uniwill-acpi.c   |  4 +--
 include/linux/led-class-multicolor.h          | 32 ++++++++++++++++-
 23 files changed, 164 insertions(+), 23 deletions(-)

-- 
2.39.5


             reply	other threads:[~2026-03-14 23:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-14 23:01 Armin Wolf [this message]
2026-03-14 23:01 ` [RFC PATCH 1/1] " Armin Wolf
2026-03-22 15:53   ` Jacek Anaszewski
2026-03-23 10:22     ` Armin Wolf
2026-03-23 18:12       ` Jacek Anaszewski
2026-03-16 16:18 ` [RFC PATCH 0/1] " Werner Sembach

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=20260314230107.65444-1-W_Armin@gmx.de \
    --to=w_armin@gmx.de \
    --cc=corbet@lwn.net \
    --cc=lee@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    --cc=pobrn@protonmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=wse@tuxedocomputers.com \
    /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®