summaryrefslogtreecommitdiffstats
path: root/include/linux/backlight.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-05-21 09:39:54 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-26 19:29:01 -0400
commit3cc6919bd61315ea60baf95f3f9868aacfd1ace4 (patch)
treee50ebe95421333e2c18a146fc449ead2b84cd0f4 /include/linux/backlight.h
parentbee564430feec1175ee64bcfd4913cacc519f817 (diff)
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 <hdegoede@redhat.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/backlight.h')
-rw-r--r--include/linux/backlight.h7
1 files changed, 7 insertions, 0 deletions
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 {
40 BACKLIGHT_TYPE_MAX, 40 BACKLIGHT_TYPE_MAX,
41}; 41};
42 42
43enum backlight_notification {
44 BACKLIGHT_REGISTERED,
45 BACKLIGHT_UNREGISTERED,
46};
47
43struct backlight_device; 48struct backlight_device;
44struct fb_info; 49struct fb_info;
45 50
@@ -133,6 +138,8 @@ extern void devm_backlight_device_unregister(struct device *dev,
133extern void backlight_force_update(struct backlight_device *bd, 138extern void backlight_force_update(struct backlight_device *bd,
134 enum backlight_update_reason reason); 139 enum backlight_update_reason reason);
135extern bool backlight_device_registered(enum backlight_type type); 140extern bool backlight_device_registered(enum backlight_type type);
141extern int backlight_register_notifier(struct notifier_block *nb);
142extern int backlight_unregister_notifier(struct notifier_block *nb);
136 143
137#define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) 144#define to_backlight_device(obj) container_of(obj, struct backlight_device, dev)
138 145