xref: /rk3399_ARM-atf/include/drivers/clk.h (revision a2c6016f927e4b9a23499005c63f3e46f48ff8a2)
1 /*
2  * Copyright (c) 2021, STMicroelectronics - All Rights Reserved
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef CLK_H
8 #define CLK_H
9 
10 #include <stdbool.h>
11 
12 struct clk_ops {
13 	int (*enable)(unsigned long id);
14 	void (*disable)(unsigned long id);
15 	unsigned long (*get_rate)(unsigned long id);
16 	int (*get_parent)(unsigned long id);
17 	int (*set_parent)(unsigned long id, unsigned long parent_id);
18 	bool (*is_enabled)(unsigned long id);
19 };
20 
21 int clk_enable(unsigned long id);
22 void clk_disable(unsigned long id);
23 unsigned long clk_get_rate(unsigned long id);
24 bool clk_is_enabled(unsigned long id);
25 int clk_get_parent(unsigned long id);
26 int clk_set_parent(unsigned long id, unsigned long parent_id);
27 
28 void clk_register(const struct clk_ops *ops);
29 
30 #endif /* CLK_H */
31