xref: /linux/drivers/clk/clk.h (revision bfc0cbfcad122c27aefad0e00da4f383954cf145)
1d6782c26SSylwester Nawrocki /*
2d6782c26SSylwester Nawrocki  * linux/drivers/clk/clk.h
3d6782c26SSylwester Nawrocki  *
4d6782c26SSylwester Nawrocki  * Copyright (C) 2013 Samsung Electronics Co., Ltd.
5d6782c26SSylwester Nawrocki  * Sylwester Nawrocki <s.nawrocki@samsung.com>
6d6782c26SSylwester Nawrocki  *
7d6782c26SSylwester Nawrocki  * This program is free software; you can redistribute it and/or modify
8d6782c26SSylwester Nawrocki  * it under the terms of the GNU General Public License version 2 as
9d6782c26SSylwester Nawrocki  * published by the Free Software Foundation.
10d6782c26SSylwester Nawrocki  */
11d6782c26SSylwester Nawrocki 
12035a61c3STomeu Vizoso struct clk_hw;
13035a61c3STomeu Vizoso 
14d6782c26SSylwester Nawrocki #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
1573e0e496SStephen Boyd struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec,
1673e0e496SStephen Boyd 				       const char *dev_id, const char *con_id);
17d6782c26SSylwester Nawrocki #endif
18035a61c3STomeu Vizoso 
1973e0e496SStephen Boyd #ifdef CONFIG_COMMON_CLK
20035a61c3STomeu Vizoso struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,
21035a61c3STomeu Vizoso 			     const char *con_id);
2273e0e496SStephen Boyd void __clk_free_clk(struct clk *clk);
23*bfc0cbfcSStephen Boyd int __clk_get(struct clk *clk);
24*bfc0cbfcSStephen Boyd void __clk_put(struct clk *clk);
2573e0e496SStephen Boyd #else
2673e0e496SStephen Boyd /* All these casts to avoid ifdefs in clkdev... */
2773e0e496SStephen Boyd static inline struct clk *
2873e0e496SStephen Boyd __clk_create_clk(struct clk_hw *hw, const char *dev_id, const char *con_id)
2973e0e496SStephen Boyd {
3073e0e496SStephen Boyd 	return (struct clk *)hw;
3173e0e496SStephen Boyd }
3273e0e496SStephen Boyd static inline void __clk_free_clk(struct clk *clk) { }
3373e0e496SStephen Boyd static struct clk_hw *__clk_get_hw(struct clk *clk)
3473e0e496SStephen Boyd {
3573e0e496SStephen Boyd 	return (struct clk_hw *)clk;
3673e0e496SStephen Boyd }
37*bfc0cbfcSStephen Boyd static inline int __clk_get(struct clk *clk) { return 1; }
38*bfc0cbfcSStephen Boyd static inline void __clk_put(struct clk *clk) { }
3973e0e496SStephen Boyd 
4073e0e496SStephen Boyd #endif
41