blob: b02f5e604e69c91db044351f94cb6fffa83d900d [file] [log] [blame]
Stephen Boydebafb632018-12-11 09:43:03 -08001/* SPDX-License-Identifier: GPL-2.0 */
Sylwester Nawrockid6782c22013-08-23 17:03:43 +02002/*
Sylwester Nawrockid6782c22013-08-23 17:03:43 +02003 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
4 * Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrockid6782c22013-08-23 17:03:43 +02005 */
6
Tomeu Vizoso035a61c2015-01-23 12:03:30 +01007struct clk_hw;
8
Sylwester Nawrockid6782c22013-08-23 17:03:43 +02009#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
Stephen Boyd73e0e492015-02-06 11:42:43 -080010struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec,
11 const char *dev_id, const char *con_id);
Sylwester Nawrockid6782c22013-08-23 17:03:43 +020012#endif
Tomeu Vizoso035a61c2015-01-23 12:03:30 +010013
Stephen Boyd73e0e492015-02-06 11:42:43 -080014#ifdef CONFIG_COMMON_CLK
Tomeu Vizoso035a61c2015-01-23 12:03:30 +010015struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,
16 const char *con_id);
Stephen Boyd73e0e492015-02-06 11:42:43 -080017void __clk_free_clk(struct clk *clk);
Stephen Boydbfc0cbf2018-01-02 16:54:16 -080018int __clk_get(struct clk *clk);
19void __clk_put(struct clk *clk);
Stephen Boyd73e0e492015-02-06 11:42:43 -080020#else
21/* All these casts to avoid ifdefs in clkdev... */
22static inline struct clk *
23__clk_create_clk(struct clk_hw *hw, const char *dev_id, const char *con_id)
24{
25 return (struct clk *)hw;
26}
27static inline void __clk_free_clk(struct clk *clk) { }
28static struct clk_hw *__clk_get_hw(struct clk *clk)
29{
30 return (struct clk_hw *)clk;
31}
Stephen Boydbfc0cbf2018-01-02 16:54:16 -080032static inline int __clk_get(struct clk *clk) { return 1; }
33static inline void __clk_put(struct clk *clk) { }
Stephen Boyd73e0e492015-02-06 11:42:43 -080034
35#endif