Thread (6 messages) 6 messages, 2 authors, 5d ago

Re: [PATCH 3/3] backlight: lp8864: Convert from LED to backlight class driver

From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
Date: 2026-06-16 07:17:28
Also in: dri-devel, linux-devicetree, linux-leds, lkml

Hi Andrew!

On Mon, 2026-06-15 at 14:51 -0500, Andrew Davis wrote:
quoted
Move the TI LP8864/LP8866 driver from drivers/leds/ to
drivers/video/backlight/
Why move it? You can register a backlight device from any directory.
I'm personally fine with the driver residing in drivers/leds, it's
just that currently there are no combined drivers there, the combined
drivers providing both interfaces only live in video/backlight.

But if it's OK from the maintainers' perspective, it will be even
more consistent regarding Kconfig symbol.
quoted
and convert it to register a backlight class
device as its primary interface.
What do you mean by "primary"? You should be able to register with
both frameworks and have the driver interop between as needed.
Well, I only meant the user's (or my own) perspective, sorry for confusion.
quoted
The motivation is a use case on a hot-pluggable segment of an I2C bus.
The generic led-backlight driver (drivers/video/backlight/led_bl.c) is a
platform driver and as such inherently non-hotpluggable.
That isn't strictly true, there is platform_device_{del,unregister}(), so
whatever your mechanism for removing the I2C device would be, the same
could be done to the led_bl device before then removing the I2C device.
led_bl is not really designed to act on dynamically instantiated devices,
it's very much device-tree affine (of_count_phandle_with_args(), etc...)
We don't want to have to move every LED driver that could possibly
be used as a backlight to the backlight framework, the led_bl.c
handles adapting LED->backlight as needed. So what you really need
here is to de-couple led_bl.c from DT so it can better handle dynamic
add/remove. Then this LED driver simply could register a "led-backlight"
platform driver to handle the backlight interface, and remove the
backlight device when it itself (the LED device) is removed.
The mechanism we have regarding hot plugging currently is just I2C bridge,
which de-registers and registers the bridged bus. So no additional drivers
are required, as long as I2C devices are self-contained and not glued with
platform devices.

So bottom line is, I'd prefer to just add the backlight interface to the
existing driver, no matter where it would live in the future.

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help