staging: fbtft: add support for a device tree of backlight.
Subsystems (4)
PATCH 1/1 staging: fbtft: add support for a device tree of backlight.
From: Chali Anis <[email protected]>
Support the of backlight from device tree and keep compatibility for the legacy gpio backlight.
Signed-off-by Chali Anis <[email protected]>
--- drivers/staging/fbtft/fbtft-core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/staging/fbtft/fbtft-core.c +12 -0
@@ -170,6 +170,18 @@ void fbtft_register_backlight(struct fbtft_par *par)struct backlight_device *bd;struct backlight_properties bl_props = {0 , }; + bd =devm_of_find_backlight (par->info->device); +if (IS_ERR (bd)) { +dev_warn (par->info->device, +"cannot find of backlight device (%ld), trying legacy\n" , +PTR_ERR (bd)); + } + +if (bd) { + par->info->bl_dev = bd; +return ; + } +if (!par->gpio.led[0 ]) {fbtft_par_dbg (DEBUG_BACKLIGHT , par,"%s(): led pin not set, exiting.\n" , __func__);
Signature · 1 line
2.34.1
Greg KH
maintainerQuoted 16 lines · On Fri, Jul 25, 2025 at 08:04:16PM -0400, [email protected] wrote:
From: Chali Anis <[email protected]>
Support the of backlight from device tree and keep compatibility for the legacy gpio backlight.
Signed-off-by Chali Anis <[email protected]>--- drivers/staging/fbtft/fbtft-core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)drivers/staging/fbtft/fbtft-core.c +0
-0
drivers/staging/fbtft/fbtft-core.c void fbtft_register_backlight(struct fbtft_par *par) · line 177
Quoted 8 lines
drivers/staging/fbtft/fbtft-core.c +5
-0@@ -170,6 +170,18 @@ void fbtft_register_backlight(struct fbtft_par *par)struct backlight_device *bd;struct backlight_properties bl_props = {0 , }; + bd =devm_of_find_backlight (par->info->device); +if (IS_ERR (bd)) { +dev_warn (par->info->device, +"cannot find of backlight device (%ld), trying legacy\n" , +PTR_ERR (bd));
So now you are going to get a warning message for a system that previously did not at all? That's not very nice to those users :(