From 3cc6919bd61315ea60baf95f3f9868aacfd1ace4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 21 May 2014 15:39:54 +0200 Subject: backlight: Add backlight device (un)registration notification Some firmware drivers, ie acpi-video want to get themselves out of the way (in some cases) when their also is a raw backlight device available. Due to module loading ordering being unknown, acpi-video cannot be certain that the backlight_device_registered(BACKLIGHT_RAW) it does for this is the final verdict wrt there being a BACKLIGHT_RAW device. By adding notification acpi-video can listen for backlight devices showing up after it has loaded, and unregister its backlight device if desired. Signed-off-by: Hans de Goede Acked-by: Jingoo Han Signed-off-by: Rafael J. Wysocki --- include/linux/backlight.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/backlight.h') diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 72647429adf6..adb14a8616df 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -40,6 +40,11 @@ enum backlight_type { BACKLIGHT_TYPE_MAX, }; +enum backlight_notification { + BACKLIGHT_REGISTERED, + BACKLIGHT_UNREGISTERED, +}; + struct backlight_device; struct fb_info; @@ -133,6 +138,8 @@ extern void devm_backlight_device_unregister(struct device *dev, extern void backlight_force_update(struct backlight_device *bd, enum backlight_update_reason reason); extern bool backlight_device_registered(enum backlight_type type); +extern int backlight_register_notifier(struct notifier_block *nb); +extern int backlight_unregister_notifier(struct notifier_block *nb); #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) -- cgit