xref: /OK3568_Linux_fs/kernel/drivers/clk/clk.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (C) 2013 Samsung Electronics Co., Ltd.
4*4882a593Smuzhiyun  * Sylwester Nawrocki <s.nawrocki@samsung.com>
5*4882a593Smuzhiyun  */
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun struct clk_hw;
8*4882a593Smuzhiyun struct device;
9*4882a593Smuzhiyun struct of_phandle_args;
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
12*4882a593Smuzhiyun struct clk_hw *of_clk_get_hw(struct device_node *np,
13*4882a593Smuzhiyun 				    int index, const char *con_id);
14*4882a593Smuzhiyun #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
of_clk_get_hw(struct device_node * np,int index,const char * con_id)15*4882a593Smuzhiyun static inline struct clk_hw *of_clk_get_hw(struct device_node *np,
16*4882a593Smuzhiyun 				    int index, const char *con_id)
17*4882a593Smuzhiyun {
18*4882a593Smuzhiyun 	return ERR_PTR(-ENOENT);
19*4882a593Smuzhiyun }
20*4882a593Smuzhiyun #endif
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id);
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun #ifdef CONFIG_COMMON_CLK
25*4882a593Smuzhiyun struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
26*4882a593Smuzhiyun 			      const char *dev_id, const char *con_id);
27*4882a593Smuzhiyun void __clk_put(struct clk *clk);
28*4882a593Smuzhiyun #else
29*4882a593Smuzhiyun /* All these casts to avoid ifdefs in clkdev... */
30*4882a593Smuzhiyun static inline struct clk *
clk_hw_create_clk(struct device * dev,struct clk_hw * hw,const char * dev_id,const char * con_id)31*4882a593Smuzhiyun clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id,
32*4882a593Smuzhiyun 		  const char *con_id)
33*4882a593Smuzhiyun {
34*4882a593Smuzhiyun 	return (struct clk *)hw;
35*4882a593Smuzhiyun }
__clk_put(struct clk * clk)36*4882a593Smuzhiyun static inline void __clk_put(struct clk *clk) { }
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #endif
39