diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2024-03-05 17:22:43 +0100 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-03-28 10:09:06 +0000 |
commit | 0a4be7263749945a3882f7a0e2e5b1c45c31064e (patch) | |
tree | 76787247220793a2de23ab1c7d15fed981533f35 /include/linux/backlight.h | |
parent | 7929446702295f7e336c13b39302589070f11560 (diff) | |
download | linux-0a4be7263749945a3882f7a0e2e5b1c45c31064e.tar.gz linux-0a4be7263749945a3882f7a0e2e5b1c45c31064e.tar.bz2 linux-0a4be7263749945a3882f7a0e2e5b1c45c31064e.zip |
backlight: Add controls_device callback to struct backlight_ops
Replace check_fb with controls_device in struct backlight_ops. The
new callback interface takes a Linux device instead of a framebuffer.
Resolves one of the dependencies of backlight.h on fb.h.
The few drivers that had custom implementations of check_fb can easily
use the framebuffer's Linux device instead. Update them accordingly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20240305162425.23845-11-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'include/linux/backlight.h')
-rw-r--r-- | include/linux/backlight.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 614653e07e3a..2db4c70053c4 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -13,6 +13,7 @@ #include <linux/fb.h> #include <linux/mutex.h> #include <linux/notifier.h> +#include <linux/types.h> /** * enum backlight_update_reason - what method was used to update backlight @@ -110,7 +111,6 @@ enum backlight_scale { }; struct backlight_device; -struct fb_info; /** * struct backlight_ops - backlight operations @@ -160,18 +160,18 @@ struct backlight_ops { int (*get_brightness)(struct backlight_device *); /** - * @check_fb: Check the framebuffer device. + * @controls_device: Check against the display device * - * Check if given framebuffer device is the one bound to this backlight. - * This operation is optional and if not implemented it is assumed that the - * fbdev is always the one bound to the backlight. + * Check if the backlight controls the given display device. This + * operation is optional and if not implemented it is assumed that + * the display is always the one controlled by the backlight. * * RETURNS: * - * If info is NULL or the info matches the fbdev bound to the backlight return true. - * If info does not match the fbdev bound to the backlight return false. + * If display_dev is NULL or display_dev matches the device controlled by + * the backlight, return true. Otherwise return false. */ - int (*check_fb)(struct backlight_device *bd, struct fb_info *info); + bool (*controls_device)(struct backlight_device *bd, struct device *display_dev); }; /** |