xref: /rk3399_ARM-atf/include/drivers/nxp/clk/s32cc/s32cc-clk-utils.h (revision 624ffe51eabc1d00bb46c8bfadb4b229d5b2f5a9)
17c36209bSGhennadi Procopciuc /* SPDX-License-Identifier: BSD-3-Clause */
27c36209bSGhennadi Procopciuc /*
37c36209bSGhennadi Procopciuc  * Copyright 2024 NXP
47c36209bSGhennadi Procopciuc  */
57c36209bSGhennadi Procopciuc #ifndef S32CC_CLK_UTILS_H
67c36209bSGhennadi Procopciuc #define S32CC_CLK_UTILS_H
77c36209bSGhennadi Procopciuc 
8*61b5ef21SGhennadi Procopciuc #include <stdbool.h>
97c36209bSGhennadi Procopciuc #include <s32cc-clk-modules.h>
107c36209bSGhennadi Procopciuc 
117c36209bSGhennadi Procopciuc struct s32cc_clk *s32cc_get_clk_from_table(const struct s32cc_clk_array *const *clk_arr,
127c36209bSGhennadi Procopciuc 					   size_t size,
137c36209bSGhennadi Procopciuc 					   unsigned long clk_id);
147c36209bSGhennadi Procopciuc 
1596e069cbSGhennadi Procopciuc int s32cc_get_id_from_table(const struct s32cc_clk_array *const *clk_arr,
1696e069cbSGhennadi Procopciuc 			    size_t size, const struct s32cc_clk *clk,
1796e069cbSGhennadi Procopciuc 			    unsigned long *clk_index);
1896e069cbSGhennadi Procopciuc 
197c36209bSGhennadi Procopciuc struct s32cc_clk *s32cc_get_arch_clk(unsigned long id);
2096e069cbSGhennadi Procopciuc int s32cc_get_clk_id(const struct s32cc_clk *clk, unsigned long *id);
217c36209bSGhennadi Procopciuc 
22*61b5ef21SGhennadi Procopciuc int s32cc_clk_register_drv(bool mmap_regs);
2366af5425SGhennadi Procopciuc 
247c36209bSGhennadi Procopciuc #endif /* S32CC_CLK_UTILS_H */
25