blob: 2d801900cad5981fb78e7c915dc27321fe674427 [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;
Stephen Boydefa85042018-12-11 08:34:16 -08008struct device;
9struct of_phandle_args;
Tomeu Vizoso035a61c2015-01-23 12:03:30 +010010
Sylwester Nawrockid6782c22013-08-23 17:03:43 +020011#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
Stephen Boydcf13f282018-12-19 15:09:14 -080012struct clk_hw *of_clk_get_hw(struct device_node *np,
13 int index, const char *con_id);
14#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
15static inline struct clk_hw *of_clk_get_hw(struct device_node *np,
16 int index, const char *con_id)
17{
18 return ERR_PTR(-ENOENT);
19}
Sylwester Nawrockid6782c22013-08-23 17:03:43 +020020#endif
Tomeu Vizoso035a61c2015-01-23 12:03:30 +010021
Stephen Boyddde4eff2019-04-12 11:31:48 -070022struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id);
23
Stephen Boyd73e0e492015-02-06 11:42:43 -080024#ifdef CONFIG_COMMON_CLK
Stephen Boydefa85042018-12-11 08:34:16 -080025struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
Stephen Boyd1df40462018-12-11 08:32:04 -080026 const char *dev_id, const char *con_id);
Stephen Boydbfc0cbf2018-01-02 16:54:16 -080027void __clk_put(struct clk *clk);
Stephen Boyd73e0e492015-02-06 11:42:43 -080028#else
29/* All these casts to avoid ifdefs in clkdev... */
30static inline struct clk *
Stephen Boydefa85042018-12-11 08:34:16 -080031clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id,
32 const char *con_id)
Stephen Boyd73e0e492015-02-06 11:42:43 -080033{
34 return (struct clk *)hw;
35}
Stephen Boydbfc0cbf2018-01-02 16:54:16 -080036static inline void __clk_put(struct clk *clk) { }
Stephen Boyd73e0e492015-02-06 11:42:43 -080037
38#endif