blob: 5ea2185e57a1cf579f55add2d73417840dd2328f [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 Boyd44722872018-12-19 10:59:55 -080012int of_parse_clkspec(const struct device_node *np, int index, const char *name,
13 struct of_phandle_args *out_args);
14struct clk_hw *of_clk_get_hw_from_clkspec(struct of_phandle_args *clkspec);
Sylwester Nawrockid6782c22013-08-23 17:03:43 +020015#endif
Tomeu Vizoso035a61c2015-01-23 12:03:30 +010016
Stephen Boyd73e0e492015-02-06 11:42:43 -080017#ifdef CONFIG_COMMON_CLK
Stephen Boydefa85042018-12-11 08:34:16 -080018struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
Stephen Boyd1df40462018-12-11 08:32:04 -080019 const char *dev_id, const char *con_id);
Stephen Boydbfc0cbf2018-01-02 16:54:16 -080020void __clk_put(struct clk *clk);
Stephen Boyd73e0e492015-02-06 11:42:43 -080021#else
22/* All these casts to avoid ifdefs in clkdev... */
23static inline struct clk *
Stephen Boydefa85042018-12-11 08:34:16 -080024clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id,
25 const char *con_id)
Stephen Boyd73e0e492015-02-06 11:42:43 -080026{
27 return (struct clk *)hw;
28}
Stephen Boyd73e0e492015-02-06 11:42:43 -080029static struct clk_hw *__clk_get_hw(struct clk *clk)
30{
31 return (struct clk_hw *)clk;
32}
Stephen Boydbfc0cbf2018-01-02 16:54:16 -080033static inline void __clk_put(struct clk *clk) { }
Stephen Boyd73e0e492015-02-06 11:42:43 -080034
35#endif