1 /*
2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #include <linux/module.h>
20 #include <linux/kernel.h>
21 #include "hi_osal.h"
22 #include "osal.h"
23
osal_init(void)24 static int __init osal_init(void)
25 {
26 if (mem_check_module_param() == -1) {
27 return -1;
28 }
29
30 osal_device_init();
31 osal_proc_init();
32 himedia_init();
33 media_mem_init();
34 osal_trace("hi_osal %s init success!\n", HI_OSAL_VERSION);
35 return 0;
36 }
37
osal_exit(void)38 static void __exit osal_exit(void)
39 {
40 himedia_exit();
41 media_mem_exit();
42 osal_proc_exit();
43 osal_trace("hi_osal v1.0 exit!\n");
44 }
45
46 module_init(osal_init);
47 module_exit(osal_exit);
48
49 MODULE_AUTHOR("Hisilicon");
50 MODULE_LICENSE("GPL");
51 MODULE_VERSION("1.0");
52