1 /*
2  * source/ekernel/drivers/drv/source/disp2/soc/platform_resource/platform_resource.h
3  *
4  * Copyright (c) 2007-2020 Allwinnertech Co., Ltd.
5  * Author: zhengxiaobin <zhengxiaobin@allwinnertech.com>
6  *
7  * This software is licensed under the terms of the GNU General Public
8  * License version 2, as published by the Free Software Foundation, and
9  * may be copied, distributed, and modified under those terms.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  */
17 #ifndef _PLATFORM_RESOURCE_H
18 #define _PLATFORM_RESOURCE_H
19 
20 #include <stdio.h>
21 #include <stdint.h>
22 #include <stdlib.h>
23 #include <hal_clk.h>
24 #include <hal_reset.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 /**
31  * clk_info
32  */
33 struct clk_info_t {
34     char name[20];
35     hal_clk_id_t clk_id;
36     hal_clk_id_t clk_parent_id;
37     hal_reset_id_t rst_id;
38     hal_clk_t clk;
39     hal_clk_t clk_parent;
40     struct reset_control *rst;
41 };
42 
43 s32 plat_get_reg_base(u32 index, u32 *data);
44 
45 s32 plat_get_irq_no(u32 index, u32 *data);
46 
47 s32 plat_get_clk(char *name, hal_clk_id_t *data);
48 
49 s32 plat_get_clk_parent(hal_clk_id_t clk, hal_clk_id_t * parent);
50 
51 s32 plat_get_clk_from_id(hal_clk_id_t clk_id, hal_clk_t *clk, struct reset_control **rst);
52 
53 s32 plat_get_rst_by_name(char *name, struct reset_control **rst);
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif /*End of file*/
59