xref: /OK3568_Linux_fs/kernel/drivers/gpu/drm/rockchip/ebc-dev/ebc_public.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (c) 2020 Rockchip Electronics Co. Ltd.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Author: Zorro Liu <zorro.liu@rock-chips.com>
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #include <linux/device.h>
9*4882a593Smuzhiyun #include <linux/err.h>
10*4882a593Smuzhiyun #include <linux/init.h>
11*4882a593Smuzhiyun #include <linux/kernel.h>
12*4882a593Smuzhiyun #include <linux/module.h>
13*4882a593Smuzhiyun #include <linux/uaccess.h>
14*4882a593Smuzhiyun #include "ebc_dev.h"
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun static BLOCKING_NOTIFIER_HEAD(ebc_notifier_list);
17*4882a593Smuzhiyun 
ebc_register_notifier(struct notifier_block * nb)18*4882a593Smuzhiyun int ebc_register_notifier(struct notifier_block *nb)
19*4882a593Smuzhiyun {
20*4882a593Smuzhiyun 	int ret = 0;
21*4882a593Smuzhiyun 	ret = blocking_notifier_chain_register(&ebc_notifier_list, nb);
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun 	return ret;
24*4882a593Smuzhiyun }
25*4882a593Smuzhiyun EXPORT_SYMBOL(ebc_register_notifier);
26*4882a593Smuzhiyun 
ebc_unregister_notifier(struct notifier_block * nb)27*4882a593Smuzhiyun int ebc_unregister_notifier(struct notifier_block *nb)
28*4882a593Smuzhiyun {
29*4882a593Smuzhiyun 	return blocking_notifier_chain_unregister(&ebc_notifier_list, nb);
30*4882a593Smuzhiyun }
31*4882a593Smuzhiyun EXPORT_SYMBOL(ebc_unregister_notifier);
32*4882a593Smuzhiyun 
ebc_notify(unsigned long event)33*4882a593Smuzhiyun int ebc_notify(unsigned long event)
34*4882a593Smuzhiyun {
35*4882a593Smuzhiyun 	return blocking_notifier_call_chain(&ebc_notifier_list, event, NULL);
36*4882a593Smuzhiyun }
37