Lines Matching refs:test

84 clk_hw_register_fixed_rate_kunit(struct kunit *test,  in clk_hw_register_fixed_rate_kunit()  argument
89 hw = kunit_alloc_resource(test, in clk_hw_register_fixed_rate_kunit()
109 static int clk_hw_unregister_fixed_rate_kunit(struct kunit *test, struct clk_hw *hw) in clk_hw_unregister_fixed_rate_kunit() argument
111 if (!kunit_alloc_resource(test, NULL, in clk_hw_unregister_fixed_rate_kunit()
123 static void clk_fixed_rate_rate_test(struct kunit *test) in clk_fixed_rate_rate_test() argument
130 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); in clk_fixed_rate_rate_test()
131 KUNIT_ASSERT_EQ(test, 0, clk_hw_unregister_fixed_rate_kunit(test, hw)); in clk_fixed_rate_rate_test()
133 clk = clk_hw_get_clk_prepared_enabled_kunit(test, hw, __func__); in clk_fixed_rate_rate_test()
134 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_fixed_rate_rate_test()
136 KUNIT_EXPECT_EQ(test, fixed_rate, clk_get_rate(clk)); in clk_fixed_rate_rate_test()
143 static void clk_fixed_rate_accuracy_test(struct kunit *test) in clk_fixed_rate_accuracy_test() argument
152 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); in clk_fixed_rate_accuracy_test()
153 KUNIT_ASSERT_EQ(test, 0, clk_hw_unregister_fixed_rate_kunit(test, hw)); in clk_fixed_rate_accuracy_test()
155 clk = clk_hw_get_clk_kunit(test, hw, __func__); in clk_fixed_rate_accuracy_test()
156 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_fixed_rate_accuracy_test()
158 KUNIT_EXPECT_EQ(test, fixed_accuracy, clk_get_accuracy(clk)); in clk_fixed_rate_accuracy_test()
176 static void clk_fixed_rate_parent_test(struct kunit *test) in clk_fixed_rate_parent_test() argument
186 parent_hw = clk_hw_register_fixed_rate_kunit(test, &parent_params); in clk_fixed_rate_parent_test()
187 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent_hw); in clk_fixed_rate_parent_test()
188 KUNIT_ASSERT_STREQ(test, parent_name, clk_hw_get_name(parent_hw)); in clk_fixed_rate_parent_test()
190 expected_parent = clk_hw_get_clk_kunit(test, parent_hw, __func__); in clk_fixed_rate_parent_test()
191 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, expected_parent); in clk_fixed_rate_parent_test()
194 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); in clk_fixed_rate_parent_test()
195 KUNIT_ASSERT_EQ(test, 0, clk_hw_unregister_fixed_rate_kunit(test, hw)); in clk_fixed_rate_parent_test()
197 clk = clk_hw_get_clk_kunit(test, hw, __func__); in clk_fixed_rate_parent_test()
198 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_fixed_rate_parent_test()
201 KUNIT_EXPECT_TRUE(test, clk_is_match(expected_parent, actual_parent)); in clk_fixed_rate_parent_test()
207 static void clk_fixed_rate_parent_rate_test(struct kunit *test) in clk_fixed_rate_parent_rate_test() argument
219 parent_hw = clk_hw_register_fixed_rate_kunit(test, &parent_params); in clk_fixed_rate_parent_rate_test()
220 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent_hw); in clk_fixed_rate_parent_rate_test()
221 KUNIT_ASSERT_STREQ(test, parent_name, clk_hw_get_name(parent_hw)); in clk_fixed_rate_parent_rate_test()
225 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); in clk_fixed_rate_parent_rate_test()
226 KUNIT_ASSERT_EQ(test, 0, clk_hw_unregister_fixed_rate_kunit(test, hw)); in clk_fixed_rate_parent_rate_test()
228 clk = clk_hw_get_clk_prepared_enabled_kunit(test, hw, __func__); in clk_fixed_rate_parent_rate_test()
229 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_fixed_rate_parent_rate_test()
231 KUNIT_EXPECT_EQ(test, expected_rate, clk_get_rate(clk)); in clk_fixed_rate_parent_rate_test()
237 static void clk_fixed_rate_parent_accuracy_test(struct kunit *test) in clk_fixed_rate_parent_accuracy_test() argument
249 parent_hw = clk_hw_register_fixed_rate_kunit(test, &parent_params); in clk_fixed_rate_parent_accuracy_test()
250 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent_hw); in clk_fixed_rate_parent_accuracy_test()
251 KUNIT_ASSERT_STREQ(test, parent_name, clk_hw_get_name(parent_hw)); in clk_fixed_rate_parent_accuracy_test()
256 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); in clk_fixed_rate_parent_accuracy_test()
257 KUNIT_ASSERT_EQ(test, 0, clk_hw_unregister_fixed_rate_kunit(test, hw)); in clk_fixed_rate_parent_accuracy_test()
259 clk = clk_hw_get_clk_kunit(test, hw, __func__); in clk_fixed_rate_parent_accuracy_test()
260 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_fixed_rate_parent_accuracy_test()
262 KUNIT_EXPECT_EQ(test, expected_accuracy, clk_get_accuracy(clk)); in clk_fixed_rate_parent_accuracy_test()
296 static void clk_fixed_rate_of_probe_test(struct kunit *test) in clk_fixed_rate_of_probe_test() argument
298 struct clk_fixed_rate_of_test_context *ctx = test->priv; in clk_fixed_rate_of_probe_test()
302 clk = clk_get_kunit(test, dev, NULL); in clk_fixed_rate_of_probe_test()
303 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_fixed_rate_of_probe_test()
305 KUNIT_ASSERT_EQ(test, 0, clk_prepare_enable_kunit(test, clk)); in clk_fixed_rate_of_probe_test()
306 KUNIT_EXPECT_EQ(test, TEST_FIXED_FREQUENCY, clk_get_rate(clk)); in clk_fixed_rate_of_probe_test()
313 static void clk_fixed_rate_of_accuracy_test(struct kunit *test) in clk_fixed_rate_of_accuracy_test() argument
315 struct clk_fixed_rate_of_test_context *ctx = test->priv; in clk_fixed_rate_of_accuracy_test()
319 clk = clk_get_kunit(test, dev, NULL); in clk_fixed_rate_of_accuracy_test()
320 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_fixed_rate_of_accuracy_test()
322 KUNIT_EXPECT_EQ(test, TEST_FIXED_ACCURACY, clk_get_accuracy(clk)); in clk_fixed_rate_of_accuracy_test()
342 static int clk_fixed_rate_of_init(struct kunit *test) in clk_fixed_rate_of_init() argument
350 KUNIT_ASSERT_EQ(test, 0, of_overlay_apply_kunit(test, kunit_clk_fixed_rate_test)); in clk_fixed_rate_of_init()
352 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_fixed_rate_of_init()
353 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); in clk_fixed_rate_of_init()
354 test->priv = ctx; in clk_fixed_rate_of_init()
362 KUNIT_ASSERT_EQ(test, 0, kunit_platform_driver_register(test, &ctx->pdrv)); in clk_fixed_rate_of_init()
363 KUNIT_ASSERT_NE(test, 0, wait_for_completion_timeout(&ctx->probed, HZ)); in clk_fixed_rate_of_init()