summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-09-06 09:52:16 +0200
committerLee Jones <lee@kernel.org>2024-09-30 17:49:41 +0200
commit26228256b796eb0145bdfb2ae34ec8c4c0ef1319 (patch)
tree9c1d7d67582cb0919d0542a80a8ecff98a1a4180 /drivers/video/backlight
parentbacklight: lcd: Rearrange code in fb_notifier_callback() (diff)
downloadlinux-26228256b796eb0145bdfb2ae34ec8c4c0ef1319.tar.xz
linux-26228256b796eb0145bdfb2ae34ec8c4c0ef1319.zip
backlight: lcd: Test against struct fb_info.lcd_dev
Add struct fb_info.lcd_dev for fbdev drivers to store a reference to their lcd device. Update the lcd's fb_notifier_callback() to test for this field. The lcd module can now detect if an lcd device belongs to an fbdev device. This works similar to the bl_dev for backlights and will allow for the removal of the check_fb callback from several fbdev driver's lcd devices. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240906075439.98476-3-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/lcd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 2f57d6867d42..c69407aed296 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -30,6 +30,7 @@ static int fb_notifier_callback(struct notifier_block *self,
struct lcd_device *ld = container_of(self, struct lcd_device, fb_notif);
struct fb_event *evdata = data;
struct fb_info *info = evdata->info;
+ struct lcd_device *fb_lcd = fb_lcd_device(info);
guard(mutex)(&ld->ops_lock);
@@ -37,6 +38,8 @@ static int fb_notifier_callback(struct notifier_block *self,
return 0;
if (ld->ops->check_fb && !ld->ops->check_fb(ld, info))
return 0;
+ if (fb_lcd && fb_lcd != ld)
+ return 0;
if (event == FB_EVENT_BLANK) {
if (ld->ops->set_power)