All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] leds: lp8864: Expose a backlight via led_bl helper
@ 2026-08-17 17:08 A. Sverdlin
  2026-08-17 17:08 ` [PATCH 1/2] backlight: led_bl: Add devm_led_backlight_register() helper A. Sverdlin
  2026-08-17 17:08 ` [PATCH 2/2] leds: lp8864: Register a backlight device A. Sverdlin
  0 siblings, 2 replies; 5+ messages in thread
From: A. Sverdlin @ 2026-08-17 17:08 UTC (permalink / raw)
  To: dri-devel, linux-fbdev
  Cc: Alexander Sverdlin, Andrew Davis, Lee Jones, Pavel Machek,
	Daniel Thompson, Jingoo Han, Helge Deller, linux-kernel,
	linux-leds

From: Alexander Sverdlin <alexander.sverdlin@siemens.com>

This series lets the TI LP8864/LP8866 LED driver expose a standard
backlight class device in addition to its LED class device, so it can
be consumed by display/panel stacks that expect a backlight.

This is a replacement for the earlier series "Convert LP8864 LED driver
to backlight class" [1], which took a much more invasive route: it moved
the driver from drivers/leds/ to drivers/video/backlight/ and added
backlight class registration on top.

Feedback on that approach was that a working LED driver should not be
relocated and re-typed just to gain a backlight interface.

The new approach keeps the LP8864 a plain LED driver and instead teaches
the existing generic led-backlight code to register a backlight on behalf
of a self-contained LED provider:

 * Patch 1 factors the backlight registration out of led_bl's probe path
   into a shared helper and exports devm_led_backlight_register(). This
   registers a backlight class device driven by a single LED, without a
   device-tree node, bound to the caller's device lifetime. The registration
   is now fully devres-managed, so the explicit .remove callback goes away.
   The exported symbol is a no-op when led-backlight support is not
   reachable (IS_REACHABLE(CONFIG_BACKLIGHT_LED)), so callers need no
   Kconfig plumbing and are not force-selected to build led_bl.

 * Patch 2 calls that helper from the LP8864 driver, spawning a backlight
   tied to the I2C device lifetime.

Compared to [1] this means:

 * The driver stays in drivers/leds/ and remains an ordinary LED driver.
 * The generic led_bl helper becomes reusable by other self-contained LED
   providers.

The motivating use case is unchanged: an LP8864 on a hot-pluggable segment
of an I2C bus. The generic led-backlight platform driver cannot react to a
dynamically (dis)appearing I2C device; letting the I2C driver register the
backlight directly makes it a self-contained, hot-plug-safe driver.

[1] https://lore.kernel.org/all/20260615120353.3409035-1-alexander.sverdlin@siemens.com/

Alexander Sverdlin (2):
  backlight: led_bl: Add devm_led_backlight_register() helper
  leds: lp8864: Register a backlight device

 drivers/leds/leds-lp8864.c       |   5 +-
 drivers/video/backlight/led_bl.c | 130 ++++++++++++++++++++-----------
 include/linux/led_bl.h           |  20 +++++
 3 files changed, 109 insertions(+), 46 deletions(-)
 create mode 100644 include/linux/led_bl.h

-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-17 17:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17 17:08 [PATCH 0/2] leds: lp8864: Expose a backlight via led_bl helper A. Sverdlin
2026-08-17 17:08 ` [PATCH 1/2] backlight: led_bl: Add devm_led_backlight_register() helper A. Sverdlin
2026-08-17 17:18   ` sashiko-bot
2026-08-17 17:08 ` [PATCH 2/2] leds: lp8864: Register a backlight device A. Sverdlin
2026-08-17 17:15   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.