blob: 31b73a0da9db33e8a61ae7e30b8d6fe5830d8272 [file] [log] [blame]
Geert Uytterhoeveneb06d6b2018-04-18 16:50:01 +02001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * OF clock helpers
4 */
5
6#ifndef __LINUX_OF_CLK_H
7#define __LINUX_OF_CLK_H
8
Geert Uytterhoeven5df86712020-02-05 20:46:49 +01009struct device_node;
10struct of_device_id;
11
Geert Uytterhoeveneb06d6b2018-04-18 16:50:01 +020012#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
13
Geert Uytterhoeven4a4472f2020-02-12 10:43:17 +010014unsigned int of_clk_get_parent_count(const struct device_node *np);
15const char *of_clk_get_parent_name(const struct device_node *np, int index);
Geert Uytterhoeveneb06d6b2018-04-18 16:50:01 +020016void of_clk_init(const struct of_device_id *matches);
17
18#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
19
Geert Uytterhoeven4a4472f2020-02-12 10:43:17 +010020static inline unsigned int of_clk_get_parent_count(const struct device_node *np)
Geert Uytterhoeveneb06d6b2018-04-18 16:50:01 +020021{
22 return 0;
23}
Geert Uytterhoeven4a4472f2020-02-12 10:43:17 +010024static inline const char *of_clk_get_parent_name(const struct device_node *np,
Geert Uytterhoeveneb06d6b2018-04-18 16:50:01 +020025 int index)
26{
27 return NULL;
28}
29static inline void of_clk_init(const struct of_device_id *matches) {}
30
31#endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */
32
33#endif /* __LINUX_OF_CLK_H */