Lines Matching full:clk

3  * KUnit helpers for clk providers and consumers
5 #include <linux/clk.h>
6 #include <linux/clk-provider.h>
11 #include <kunit/clk.h>
15 clk_disable_unprepare, struct clk *);
19 * @clk: clk to prepare and enable
23 int clk_prepare_enable_kunit(struct kunit *test, struct clk *clk) in clk_prepare_enable_kunit() argument
27 ret = clk_prepare_enable(clk); in clk_prepare_enable_kunit()
32 clk); in clk_prepare_enable_kunit()
36 KUNIT_DEFINE_ACTION_WRAPPER(clk_put_wrapper, clk_put, struct clk *);
38 static struct clk *__clk_get_kunit(struct kunit *test, struct clk *clk) in __clk_get_kunit() argument
42 if (IS_ERR(clk)) in __clk_get_kunit()
43 return clk; in __clk_get_kunit()
45 ret = kunit_add_action_or_reset(test, clk_put_wrapper, clk); in __clk_get_kunit()
49 return clk; in __clk_get_kunit()
58 * Just like clk_get(), except the clk is managed by the test case and is
61 * Return: new clk consumer or ERR_PTR on failure.
63 struct clk *
66 struct clk *clk; in clk_get_kunit() local
68 clk = clk_get(dev, con_id); in clk_get_kunit()
70 return __clk_get_kunit(test, clk); in clk_get_kunit()
80 * Just like of_clk_get(), except the clk is managed by the test case and is
83 * Return: new clk consumer or ERR_PTR on failure.
85 struct clk *
88 struct clk *clk; in of_clk_get_kunit() local
90 clk = of_clk_get(np, index); in of_clk_get_kunit()
92 return __clk_get_kunit(test, clk); in of_clk_get_kunit()
99 * @hw: clk_hw associated with the clk being consumed
102 * Just like clk_hw_get_clk(), except the clk is managed by the test case and
105 * Return: new clk consumer or ERR_PTR on failure.
107 struct clk *
110 struct clk *clk; in clk_hw_get_clk_kunit() local
112 clk = clk_hw_get_clk(hw, con_id); in clk_hw_get_clk_kunit()
114 return __clk_get_kunit(test, clk); in clk_hw_get_clk_kunit()
121 * @hw: clk_hw associated with the clk being consumed
128 * struct clk *clk = clk_hw_get_clk(...);
129 * clk_prepare_enable(clk);
131 * except the clk is managed by the test case and is automatically disabled and
135 * Return: new clk consumer that is prepared and enabled or ERR_PTR on failure.
137 struct clk *
142 struct clk *clk; in clk_hw_get_clk_prepared_enabled_kunit() local
144 clk = clk_hw_get_clk_kunit(test, hw, con_id); in clk_hw_get_clk_prepared_enabled_kunit()
145 if (IS_ERR(clk)) in clk_hw_get_clk_prepared_enabled_kunit()
146 return clk; in clk_hw_get_clk_prepared_enabled_kunit()
148 ret = clk_prepare_enable_kunit(test, clk); in clk_hw_get_clk_prepared_enabled_kunit()
152 return clk; in clk_hw_get_clk_prepared_enabled_kunit()
165 * Just like clk_hw_register(), except the clk registration is managed by the
188 * Just like of_clk_hw_register(), except the clk registration is managed by
237 MODULE_DESCRIPTION("KUnit helpers for clk providers and consumers");