18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (C) 2013 Samsung Electronics Co., Ltd. 48c2ecf20Sopenharmony_ci * Sylwester Nawrocki <s.nawrocki@samsung.com> 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_cistruct clk_hw; 88c2ecf20Sopenharmony_cistruct device; 98c2ecf20Sopenharmony_cistruct of_phandle_args; 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) 128c2ecf20Sopenharmony_cistruct clk_hw *of_clk_get_hw(struct device_node *np, 138c2ecf20Sopenharmony_ci int index, const char *con_id); 148c2ecf20Sopenharmony_ci#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */ 158c2ecf20Sopenharmony_cistatic inline struct clk_hw *of_clk_get_hw(struct device_node *np, 168c2ecf20Sopenharmony_ci int index, const char *con_id) 178c2ecf20Sopenharmony_ci{ 188c2ecf20Sopenharmony_ci return ERR_PTR(-ENOENT); 198c2ecf20Sopenharmony_ci} 208c2ecf20Sopenharmony_ci#endif 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_cistruct clk_hw *clk_find_hw(const char *dev_id, const char *con_id); 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#ifdef CONFIG_COMMON_CLK 258c2ecf20Sopenharmony_cistruct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw, 268c2ecf20Sopenharmony_ci const char *dev_id, const char *con_id); 278c2ecf20Sopenharmony_civoid __clk_put(struct clk *clk); 288c2ecf20Sopenharmony_ci#else 298c2ecf20Sopenharmony_ci/* All these casts to avoid ifdefs in clkdev... */ 308c2ecf20Sopenharmony_cistatic inline struct clk * 318c2ecf20Sopenharmony_ciclk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id, 328c2ecf20Sopenharmony_ci const char *con_id) 338c2ecf20Sopenharmony_ci{ 348c2ecf20Sopenharmony_ci return (struct clk *)hw; 358c2ecf20Sopenharmony_ci} 368c2ecf20Sopenharmony_cistatic inline void __clk_put(struct clk *clk) { } 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#endif 39