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