Message ID | 20250226093456.147402-7-tzimmermann@suse.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | backlight, lcd, led: Remove fbdev dependencies | expand |
Hi Thomas, kernel test robot noticed the following build errors: [auto build test ERROR on lee-backlight/for-backlight-next] [also build test ERROR on lee-leds/for-leds-next linus/master lee-backlight/for-backlight-fixes v6.14-rc4] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/fbdev-Rework-fb_blank/20250226-174013 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next patch link: https://lore.kernel.org/r/20250226093456.147402-7-tzimmermann%40suse.de patch subject: [PATCH v2 06/11] backlight: Replace fb events with a dedicated function call config: arc-randconfig-002-20250227 (https://download.01.org/0day-ci/archive/20250227/202502271951.iaH6W6q1-lkp@intel.com/config) compiler: arc-elf-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250227/202502271951.iaH6W6q1-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202502271951.iaH6W6q1-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from drivers/video/cmdline.c:19: >> include/linux/fb.h:767:6: warning: no previous prototype for 'fb_bl_notify_blank' [-Wmissing-prototypes] 767 | void fb_bl_notify_blank(struct fb_info *info, int old_blank) | ^~~~~~~~~~~~~~~~~~ -- arc-elf-ld: drivers/video/cmdline.o: in function `fb_bl_notify_blank': >> cmdline.c:(.text+0x9c): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/adp8860_bl.o: in function `fb_bl_notify_blank': adp8860_bl.c:(.text+0xefc): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/as3711_bl.o: in function `fb_bl_notify_blank': as3711_bl.c:(.text+0x85c): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/backlight.o: in function `fb_bl_notify_blank': backlight.c:(.text+0xa34): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/da9052_bl.o: in function `fb_bl_notify_blank': da9052_bl.c:(.text+0x20c): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/ktd253-backlight.o: in function `fb_bl_notify_blank': ktd253-backlight.c:(.text+0x36c): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/lv5207lp.o: in function `fb_bl_notify_blank': lv5207lp.c:(.text+0x224): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/max8925_bl.o: in function `fb_bl_notify_blank': max8925_bl.c:(.text+0x3c8): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/mp3309c.o: in function `fb_bl_notify_blank': mp3309c.c:(.text+0x730): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/pandora_bl.o: in function `fb_bl_notify_blank': pandora_bl.c:(.text+0x294): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/pwm_bl.o: in function `fb_bl_notify_blank': pwm_bl.c:(.text+0xd08): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/video/backlight/qcom-wled.o: in function `fb_bl_notify_blank': qcom-wled.c:(.text+0x1f34): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/regulator/rpi-panel-attiny-regulator.o: in function `fb_bl_notify_blank': rpi-panel-attiny-regulator.c:(.text+0x5f4): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/drm_edid.o: in function `fb_bl_notify_blank': include/linux/fb.h:768: multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/drm_file.o: in function `fb_bl_notify_blank': include/linux/fb.h:768: multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/drm_modes.o: in function `fb_bl_notify_blank': include/linux/fb.h:768: multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/drm_panel.o: in function `fb_bl_notify_blank': include/linux/fb.h:768: multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/display/drm_dp_helper.o: in function `fb_bl_notify_blank': include/linux/fb.h:768: multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.o: in function `fb_bl_notify_blank': panel-asus-z00t-tm5p5-n35596.c:(.text+0x654): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-jdi-lpm102a188a.o: in function `fb_bl_notify_blank': panel-jdi-lpm102a188a.c:(.text+0x9c4): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-lg-sw43408.o: in function `fb_bl_notify_blank': panel-lg-sw43408.c:(.text+0x4ec): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-novatek-nt35560.o: in function `fb_bl_notify_blank': panel-novatek-nt35560.c:(.text+0x784): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-raydium-rm69380.o: in function `fb_bl_notify_blank': panel-raydium-rm69380.c:(.text+0x59c): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.o: in function `fb_bl_notify_blank': panel-samsung-s6d7aa0.c:(.text+0x92c): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-samsung-sofef00.o: in function `fb_bl_notify_blank': panel-samsung-sofef00.c:(.text+0x4f8): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.o: in function `fb_bl_notify_blank': panel-sony-tulip-truly-nt35521.c:(.text+0xf38): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-truly-nt35597.o: in function `fb_bl_notify_blank': panel-truly-nt35597.c:(.text+0x7c8): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/panel/panel-visionox-r66451.o: in function `fb_bl_notify_blank': panel-visionox-r66451.c:(.text+0x704): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/gpu/drm/bridge/parade-ps8622.o: in function `fb_bl_notify_blank': parade-ps8622.c:(.text+0x7e0): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/hid/hid-picolcd_core.o: in function `fb_bl_notify_blank': hid-picolcd_core.c:(.text+0xca4): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/hid/hid-picolcd_backlight.o: in function `fb_bl_notify_blank': include/linux/fb.h:768: multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/hid/hid-picolcd_debugfs.o: in function `fb_bl_notify_blank': include/linux/fb.h:768: multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here arc-elf-ld: drivers/of/platform.o: in function `fb_bl_notify_blank': platform.c:(.text+0xb10): multiple definition of `fb_bl_notify_blank'; drivers/video/aperture.o:include/linux/fb.h:768: first defined here
Hi Thomas, kernel test robot noticed the following build errors: [auto build test ERROR on lee-backlight/for-backlight-next] [also build test ERROR on lee-leds/for-leds-next linus/master lee-backlight/for-backlight-fixes v6.14-rc4 next-20250227] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/fbdev-Rework-fb_blank/20250226-174013 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next patch link: https://lore.kernel.org/r/20250226093456.147402-7-tzimmermann%40suse.de patch subject: [PATCH v2 06/11] backlight: Replace fb events with a dedicated function call config: arm-randconfig-002-20250227 (https://download.01.org/0day-ci/archive/20250227/202502272049.iWEcMOrk-lkp@intel.com/config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250227/202502272049.iWEcMOrk-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202502272049.iWEcMOrk-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from arch/arm/mach-omap2/fb.c:16: In file included from include/linux/omapfb.h:13: In file included from include/uapi/linux/omapfb.h:28: >> include/linux/fb.h:767:6: warning: no previous prototype for function 'fb_bl_notify_blank' [-Wmissing-prototypes] 767 | void fb_bl_notify_blank(struct fb_info *info, int old_blank) | ^ include/linux/fb.h:767:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 767 | void fb_bl_notify_blank(struct fb_info *info, int old_blank) | ^ | static 1 warning generated. -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-vdi.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-smfc.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-cpmem.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-image-convert.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-ic-csc.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-ic.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-dmfc.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-dp.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-di.o:(.text+0x0) -- >> ld.lld: error: duplicate symbol: fb_bl_notify_blank >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-common.o:(fb_bl_notify_blank) >>> defined at fb.h:768 (include/linux/fb.h:768) >>> drivers/gpu/ipu-v3/ipu-dc.o:(.text+0x0) ..
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 1c43f579396f..9dc93c5e480b 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -15,7 +15,6 @@ #include <linux/notifier.h> #include <linux/ctype.h> #include <linux/err.h> -#include <linux/fb.h> #include <linux/slab.h> #ifdef CONFIG_PMAC_BACKLIGHT @@ -57,10 +56,10 @@ * a hot-key to adjust backlight, the driver must notify the backlight * core that brightness has changed using backlight_force_update(). * - * The backlight driver core receives notifications from fbdev and - * if the event is FB_EVENT_BLANK and if the value of blank, from the - * FBIOBLANK ioctrl, results in a change in the backlight state the - * update_status() operation is called. + * Display drives can control the backlight device's status using + * backlight_notify_blank() and backlight_notify_blank_all(). If this + * results in a change in the backlight state the functions call the + * update_status() operation. */ static struct list_head backlight_dev_list; @@ -78,11 +77,8 @@ static const char *const backlight_scale_types[] = { [BACKLIGHT_SCALE_NON_LINEAR] = "non-linear", }; -#if defined(CONFIG_FB_CORE) || (defined(CONFIG_FB_CORE_MODULE) && \ - defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)) -static void backlight_notify_blank(struct backlight_device *bd, - struct device *display_dev, - bool fb_on, bool prev_fb_on) +void backlight_notify_blank(struct backlight_device *bd, struct device *display_dev, + bool fb_on, bool prev_fb_on) { guard(mutex)(&bd->ops_lock); @@ -103,68 +99,18 @@ static void backlight_notify_blank(struct backlight_device *bd, } } } +EXPORT_SYMBOL(backlight_notify_blank); -/* - * fb_notifier_callback - * - * This callback gets called when something important happens inside a - * framebuffer driver. The backlight core only cares about FB_BLANK_UNBLANK - * which is reported to the driver using backlight_update_status() - * as a state change. - * - * There may be several fbdev's connected to the backlight device, - * in which case they are kept track of. A state change is only reported - * if there is a change in backlight for the specified fbdev. - */ -static int fb_notifier_callback(struct notifier_block *self, - unsigned long event, void *data) +void backlight_notify_blank_all(struct device *display_dev, bool fb_on, bool prev_fb_on) { struct backlight_device *bd; - struct fb_event *evdata = data; - struct fb_info *info = evdata->info; - const int *fb_blank = evdata->data; - struct backlight_device *fb_bd = fb_bl_device(info); - bool fb_on, prev_fb_on; - - /* If we aren't interested in this event, skip it immediately ... */ - if (event != FB_EVENT_BLANK) - return 0; - - bd = container_of(self, struct backlight_device, fb_notif); - - if (fb_bd && fb_bd != bd) - return 0; - - fb_on = fb_blank[0] == FB_BLANK_UNBLANK; - prev_fb_on = fb_blank[1] == FB_BLANK_UNBLANK; - - backlight_notify_blank(bd, info->device, fb_on, prev_fb_on); - - return 0; -} - -static int backlight_register_fb(struct backlight_device *bd) -{ - memset(&bd->fb_notif, 0, sizeof(bd->fb_notif)); - bd->fb_notif.notifier_call = fb_notifier_callback; - return fb_register_client(&bd->fb_notif); -} + guard(mutex)(&backlight_dev_list_mutex); -static void backlight_unregister_fb(struct backlight_device *bd) -{ - fb_unregister_client(&bd->fb_notif); -} -#else -static inline int backlight_register_fb(struct backlight_device *bd) -{ - return 0; + list_for_each_entry(bd, &backlight_dev_list, entry) + backlight_notify_blank(bd, display_dev, fb_on, prev_fb_on); } - -static inline void backlight_unregister_fb(struct backlight_device *bd) -{ -} -#endif /* CONFIG_FB_CORE */ +EXPORT_SYMBOL(backlight_notify_blank_all); static void backlight_generate_event(struct backlight_device *bd, enum backlight_update_reason reason) @@ -455,12 +401,6 @@ struct backlight_device *backlight_device_register(const char *name, return ERR_PTR(rc); } - rc = backlight_register_fb(new_bd); - if (rc) { - device_unregister(&new_bd->dev); - return ERR_PTR(rc); - } - new_bd->ops = ops; #ifdef CONFIG_PMAC_BACKLIGHT @@ -547,7 +487,6 @@ void backlight_device_unregister(struct backlight_device *bd) bd->ops = NULL; mutex_unlock(&bd->ops_lock); - backlight_unregister_fb(bd); device_unregister(&bd->dev); } EXPORT_SYMBOL(backlight_device_unregister); diff --git a/drivers/video/fbdev/core/fb_backlight.c b/drivers/video/fbdev/core/fb_backlight.c index 6fdaa9f81be9..dbed9696f4c5 100644 --- a/drivers/video/fbdev/core/fb_backlight.c +++ b/drivers/video/fbdev/core/fb_backlight.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/backlight.h> #include <linux/export.h> #include <linux/fb.h> #include <linux/mutex.h> @@ -36,4 +37,15 @@ struct backlight_device *fb_bl_device(struct fb_info *info) return info->bl_dev; } EXPORT_SYMBOL(fb_bl_device); + +void fb_bl_notify_blank(struct fb_info *info, int old_blank) +{ + bool on = info->blank == FB_BLANK_UNBLANK; + bool prev_on = old_blank == FB_BLANK_UNBLANK; + + if (info->bl_dev) + backlight_notify_blank(info->bl_dev, info->device, on, prev_on); + else + backlight_notify_blank_all(info->device, on, prev_on); +} #endif diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 9650b641d8e8..c931f270ac34 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -363,6 +363,8 @@ int fb_blank(struct fb_info *info, int blank) if (ret) goto err; + fb_bl_notify_blank(info, old_blank); + fb_notifier_call_chain(FB_EVENT_BLANK, &event); return 0; diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 03723a5478f8..7ed99cfd030f 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -12,7 +12,6 @@ #include <linux/device.h> #include <linux/fb.h> #include <linux/mutex.h> -#include <linux/notifier.h> #include <linux/types.h> /** @@ -278,11 +277,6 @@ struct backlight_device { */ const struct backlight_ops *ops; - /** - * @fb_notif: The framebuffer notifier block - */ - struct notifier_block fb_notif; - /** * @entry: List entry of all registered backlight devices */ @@ -400,6 +394,12 @@ struct backlight_device *backlight_device_get_by_type(enum backlight_type type); int backlight_device_set_brightness(struct backlight_device *bd, unsigned long brightness); +void backlight_notify_blank(struct backlight_device *bd, + struct device *display_dev, + bool fb_on, bool prev_fb_on); +void backlight_notify_blank_all(struct device *display_dev, + bool fb_on, bool prev_fb_on); + #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) /** diff --git a/include/linux/fb.h b/include/linux/fb.h index f41d3334ac23..bebf279c8bc6 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -757,11 +757,15 @@ extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max) #if IS_ENABLED(CONFIG_FB_BACKLIGHT) struct backlight_device *fb_bl_device(struct fb_info *info); +void fb_bl_notify_blank(struct fb_info *info, int old_blank); #else static inline struct backlight_device *fb_bl_device(struct fb_info *info) { return NULL; } + +void fb_bl_notify_blank(struct fb_info *info, int old_blank) +{ } #endif static inline struct lcd_device *fb_lcd_device(struct fb_info *info)
Remove support for fb events from backlight subsystem. Provide the helper backlight_notify_blank_all() instead. Also export the existing helper backlight_notify_blank() to update a single backlight device. In fbdev, call either helper to inform the backlight subsystem of changes to a display's blank state. If the framebuffer device has a specific backlight, only update this one; otherwise update all. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> --- drivers/video/backlight/backlight.c | 85 ++++--------------------- drivers/video/fbdev/core/fb_backlight.c | 12 ++++ drivers/video/fbdev/core/fbmem.c | 2 + include/linux/backlight.h | 12 ++-- include/linux/fb.h | 4 ++ 5 files changed, 36 insertions(+), 79 deletions(-)