2018-12-11 18:43:03 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2013-08-23 17:03:43 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Samsung Electronics Co., Ltd.
|
|
|
|
* Sylwester Nawrocki <s.nawrocki@samsung.com>
|
|
|
|
*/
|
|
|
|
|
2015-01-23 12:03:30 +01:00
|
|
|
struct clk_hw;
|
2018-12-11 17:34:16 +01:00
|
|
|
struct device;
|
|
|
|
struct of_phandle_args;
|
2015-01-23 12:03:30 +01:00
|
|
|
|
2013-08-23 17:03:43 +02:00
|
|
|
#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
|
2018-12-20 00:09:14 +01:00
|
|
|
struct clk_hw *of_clk_get_hw(struct device_node *np,
|
|
|
|
int index, const char *con_id);
|
|
|
|
#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
|
|
|
|
static inline struct clk_hw *of_clk_get_hw(struct device_node *np,
|
|
|
|
int index, const char *con_id)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-ENOENT);
|
|
|
|
}
|
2013-08-23 17:03:43 +02:00
|
|
|
#endif
|
2015-01-23 12:03:30 +01:00
|
|
|
|
2019-04-12 20:31:48 +02:00
|
|
|
struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id);
|
|
|
|
|
2015-02-06 20:42:43 +01:00
|
|
|
#ifdef CONFIG_COMMON_CLK
|
2018-12-11 17:34:16 +01:00
|
|
|
struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
|
2018-12-11 17:32:04 +01:00
|
|
|
const char *dev_id, const char *con_id);
|
2018-01-03 01:54:16 +01:00
|
|
|
void __clk_put(struct clk *clk);
|
2015-02-06 20:42:43 +01:00
|
|
|
#else
|
|
|
|
/* All these casts to avoid ifdefs in clkdev... */
|
|
|
|
static inline struct clk *
|
2018-12-11 17:34:16 +01:00
|
|
|
clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id,
|
|
|
|
const char *con_id)
|
2015-02-06 20:42:43 +01:00
|
|
|
{
|
|
|
|
return (struct clk *)hw;
|
|
|
|
}
|
|
|
|
static struct clk_hw *__clk_get_hw(struct clk *clk)
|
|
|
|
{
|
|
|
|
return (struct clk_hw *)clk;
|
|
|
|
}
|
2018-01-03 01:54:16 +01:00
|
|
|
static inline void __clk_put(struct clk *clk) { }
|
2015-02-06 20:42:43 +01:00
|
|
|
|
|
|
|
#endif
|