--- /dev/null
+/*
+ * linux/drivers/video/fb_notify.c
+ *
+ * Copyright (C) 2006 Antonino Daplas <adaplas@pol.net>
+ *
+ * 2001 - Documented with DocBook
+ * - Brad Douglas <brad@neruo.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+#include <linux/fb.h>
+#include <linux/notifier.h>
+
+static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
+
+/**
+ * fb_register_client - register a client notifier
+ * @nb: notifier block to callback on events
+ */
+int fb_register_client(struct notifier_block *nb)
+{
+ return blocking_notifier_chain_register(&fb_notifier_list, nb);
+}
+EXPORT_SYMBOL(fb_register_client);
+
+/**
+ * fb_unregister_client - unregister a client notifier
+ * @nb: notifier block to callback on events
+ */
+int fb_unregister_client(struct notifier_block *nb)
+{
+ return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
+}
+EXPORT_SYMBOL(fb_unregister_client);
+
+/**
+ * fb_notifier_call_chain - notify clients of fb_events
+ *
+ */
+int fb_notifier_call_chain(unsigned long val, void *v)
+{
+ return blocking_notifier_call_chain(&fb_notifier_list, val, v);
+}
+EXPORT_SYMBOL_GPL(fb_notifier_call_chain);
#define FBPIXMAPSIZE (1024 * 8)
-static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
struct fb_info *registered_fb[FB_MAX];
int num_registered_fb;
event.info = info;
event.data = &mode1;
- ret = blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_MODE_DELETE, &event);
+ ret = fb_notifier_call_chain(FB_EVENT_MODE_DELETE, &event);
}
if (!ret)
info->flags &= ~FBINFO_MISC_USEREVENT;
event.info = info;
- blocking_notifier_call_chain(&fb_notifier_list,
- evnt, &event);
+ fb_notifier_call_chain(evnt, &event);
}
}
}
event.info = info;
event.data = ␣
- blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_BLANK, &event);
+ fb_notifier_call_chain(FB_EVENT_BLANK, &event);
}
return ret;
con2fb.framebuffer = -1;
event.info = info;
event.data = &con2fb;
- blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_GET_CONSOLE_MAP, &event);
+ fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event);
return copy_to_user(argp, &con2fb,
sizeof(con2fb)) ? -EFAULT : 0;
case FBIOPUT_CON2FBMAP:
return -EINVAL;
event.info = info;
event.data = &con2fb;
- return blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_SET_CONSOLE_MAP,
- &event);
+ return fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP,
+ &event);
case FBIOBLANK:
acquire_console_sem();
info->flags |= FBINFO_MISC_USEREVENT;
registered_fb[i] = fb_info;
event.info = fb_info;
- blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_FB_REGISTERED, &event);
+ fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
return 0;
}
fb_cleanup_class_device(fb_info);
class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
event.info = fb_info;
- blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_FB_UNREGISTERED, &event);
+ fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
return 0;
}
-/**
- * fb_register_client - register a client notifier
- * @nb: notifier block to callback on events
- */
-int fb_register_client(struct notifier_block *nb)
-{
- return blocking_notifier_chain_register(&fb_notifier_list, nb);
-}
-
-/**
- * fb_unregister_client - unregister a client notifier
- * @nb: notifier block to callback on events
- */
-int fb_unregister_client(struct notifier_block *nb)
-{
- return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
-}
-
/**
* fb_set_suspend - low level driver signals suspend
* @info: framebuffer affected
event.info = info;
if (state) {
- blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_SUSPEND, &event);
+ fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
info->state = FBINFO_STATE_SUSPENDED;
} else {
info->state = FBINFO_STATE_RUNNING;
- blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_RESUME, &event);
+ fb_notifier_call_chain(FB_EVENT_RESUME, &event);
}
}
if (!list_empty(&info->modelist)) {
event.info = info;
- err = blocking_notifier_call_chain(&fb_notifier_list,
- FB_EVENT_NEW_MODELIST,
- &event);
+ err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
}
return err;
EXPORT_SYMBOL(fb_pan_display);
EXPORT_SYMBOL(fb_get_buffer_offset);
EXPORT_SYMBOL(fb_set_suspend);
-EXPORT_SYMBOL(fb_register_client);
-EXPORT_SYMBOL(fb_unregister_client);
EXPORT_SYMBOL(fb_get_options);
MODULE_LICENSE("GPL");