Lines Matching refs:test

144 static int clk_test_init_with_ops(struct kunit *test, const struct clk_ops *ops)  in clk_test_init_with_ops()  argument
150 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_test_init_with_ops()
154 test->priv = ctx; in clk_test_init_with_ops()
167 static int clk_test_init(struct kunit *test) in clk_test_init() argument
169 return clk_test_init_with_ops(test, &clk_dummy_rate_ops); in clk_test_init()
172 static int clk_maximize_test_init(struct kunit *test) in clk_maximize_test_init() argument
174 return clk_test_init_with_ops(test, &clk_dummy_maximize_rate_ops); in clk_maximize_test_init()
177 static int clk_minimize_test_init(struct kunit *test) in clk_minimize_test_init() argument
179 return clk_test_init_with_ops(test, &clk_dummy_minimize_rate_ops); in clk_minimize_test_init()
182 static void clk_test_exit(struct kunit *test) in clk_test_exit() argument
184 struct clk_dummy_context *ctx = test->priv; in clk_test_exit()
192 static void clk_test_get_rate(struct kunit *test) in clk_test_get_rate() argument
194 struct clk_dummy_context *ctx = test->priv; in clk_test_get_rate()
200 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_get_rate()
201 KUNIT_EXPECT_EQ(test, rate, ctx->rate); in clk_test_get_rate()
213 static void clk_test_set_get_rate(struct kunit *test) in clk_test_set_get_rate() argument
215 struct clk_dummy_context *ctx = test->priv; in clk_test_set_get_rate()
220 KUNIT_ASSERT_EQ(test, in clk_test_set_get_rate()
225 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_set_get_rate()
226 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_set_get_rate()
238 static void clk_test_set_set_get_rate(struct kunit *test) in clk_test_set_set_get_rate() argument
240 struct clk_dummy_context *ctx = test->priv; in clk_test_set_set_get_rate()
245 KUNIT_ASSERT_EQ(test, in clk_test_set_set_get_rate()
249 KUNIT_ASSERT_EQ(test, in clk_test_set_set_get_rate()
254 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_set_set_get_rate()
255 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_set_set_get_rate()
264 static void clk_test_round_set_get_rate(struct kunit *test) in clk_test_round_set_get_rate() argument
266 struct clk_dummy_context *ctx = test->priv; in clk_test_round_set_get_rate()
272 KUNIT_ASSERT_GT(test, rounded_rate, 0); in clk_test_round_set_get_rate()
273 KUNIT_EXPECT_EQ(test, rounded_rate, DUMMY_CLOCK_RATE_1); in clk_test_round_set_get_rate()
275 KUNIT_ASSERT_EQ(test, in clk_test_round_set_get_rate()
280 KUNIT_ASSERT_GT(test, set_rate, 0); in clk_test_round_set_get_rate()
281 KUNIT_EXPECT_EQ(test, rounded_rate, set_rate); in clk_test_round_set_get_rate()
306 static int clk_uncached_test_init(struct kunit *test) in clk_uncached_test_init() argument
311 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_uncached_test_init()
314 test->priv = ctx; in clk_uncached_test_init()
333 static void clk_test_uncached_get_rate(struct kunit *test) in clk_test_uncached_get_rate() argument
335 struct clk_dummy_context *ctx = test->priv; in clk_test_uncached_get_rate()
341 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_get_rate()
342 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); in clk_test_uncached_get_rate()
347 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_get_rate()
348 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_uncached_get_rate()
357 static void clk_test_uncached_set_range(struct kunit *test) in clk_test_uncached_set_range() argument
359 struct clk_dummy_context *ctx = test->priv; in clk_test_uncached_set_range()
364 KUNIT_ASSERT_EQ(test, in clk_test_uncached_set_range()
371 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_set_range()
372 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_uncached_set_range()
373 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_uncached_set_range()
386 static void clk_test_uncached_updated_rate_set_range(struct kunit *test) in clk_test_uncached_updated_rate_set_range() argument
388 struct clk_dummy_context *ctx = test->priv; in clk_test_uncached_updated_rate_set_range()
395 KUNIT_ASSERT_EQ(test, in clk_test_uncached_updated_rate_set_range()
402 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_updated_rate_set_range()
403 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_uncached_updated_rate_set_range()
428 clk_multiple_parents_mux_test_init(struct kunit *test) in clk_multiple_parents_mux_test_init() argument
434 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_multiple_parents_mux_test_init()
437 test->priv = ctx; in clk_multiple_parents_mux_test_init()
467 clk_multiple_parents_mux_test_exit(struct kunit *test) in clk_multiple_parents_mux_test_exit() argument
469 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_multiple_parents_mux_test_exit()
481 clk_test_multiple_parents_mux_get_parent(struct kunit *test) in clk_test_multiple_parents_mux_get_parent() argument
483 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_multiple_parents_mux_get_parent()
488 KUNIT_EXPECT_TRUE(test, clk_is_match(clk_get_parent(clk), parent)); in clk_test_multiple_parents_mux_get_parent()
499 clk_test_multiple_parents_mux_has_parent(struct kunit *test) in clk_test_multiple_parents_mux_has_parent() argument
501 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_multiple_parents_mux_has_parent()
507 KUNIT_EXPECT_TRUE(test, clk_has_parent(clk, parent)); in clk_test_multiple_parents_mux_has_parent()
511 KUNIT_EXPECT_TRUE(test, clk_has_parent(clk, parent)); in clk_test_multiple_parents_mux_has_parent()
527 clk_test_multiple_parents_mux_set_range_set_parent_get_rate(struct kunit *test) in clk_test_multiple_parents_mux_set_range_set_parent_get_rate() argument
529 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
536 kunit_skip(test, "This needs to be fixed in the core."); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
539 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent1); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
540 KUNIT_ASSERT_TRUE(test, clk_is_match(clk_get_parent(clk), parent1)); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
543 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent2); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
546 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
549 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
554 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
557 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
560 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
561 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
562 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
592 clk_orphan_transparent_multiple_parent_mux_test_init(struct kunit *test) in clk_orphan_transparent_multiple_parent_mux_test_init() argument
598 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_orphan_transparent_multiple_parent_mux_test_init()
601 test->priv = ctx; in clk_orphan_transparent_multiple_parent_mux_test_init()
622 clk_orphan_transparent_multiple_parent_mux_test_exit(struct kunit *test) in clk_orphan_transparent_multiple_parent_mux_test_exit() argument
624 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_orphan_transparent_multiple_parent_mux_test_exit()
635 clk_test_orphan_transparent_multiple_parent_mux_get_parent(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_get_parent() argument
637 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_get_parent()
641 KUNIT_EXPECT_PTR_EQ(test, clk_get_parent(clk), NULL); in clk_test_orphan_transparent_multiple_parent_mux_get_parent()
652 clk_test_orphan_transparent_multiple_parent_mux_set_parent(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_parent() argument
654 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
661 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
664 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
667 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
668 KUNIT_EXPECT_TRUE(test, clk_is_match(parent, new_parent)); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
680 clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range() argument
682 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
690 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
693 KUNIT_ASSERT_GT(test, parent_rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
696 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
699 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
702 KUNIT_ASSERT_GT(test, new_parent_rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
703 KUNIT_EXPECT_EQ(test, parent_rate, new_parent_rate); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
714 clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate() argument
716 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
724 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
727 KUNIT_ASSERT_GT(test, parent_rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
730 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
733 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
734 KUNIT_EXPECT_EQ(test, parent_rate, rate); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
745 clk_test_orphan_transparent_multiple_parent_mux_set_parent_put(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put() argument
747 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
753 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
756 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
759 KUNIT_ASSERT_GT(test, parent_rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
762 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
767 KUNIT_ASSERT_GT(test, new_parent_rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
768 KUNIT_EXPECT_EQ(test, parent_rate, new_parent_rate); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
779 clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified() argument
781 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
789 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
792 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
795 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
798 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
799 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
800 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
812 clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched() argument
814 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
822 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
825 KUNIT_ASSERT_GT(test, parent_rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
828 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
833 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
836 KUNIT_ASSERT_GT(test, new_parent_rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
837 KUNIT_EXPECT_EQ(test, parent_rate, new_parent_rate); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
849 clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate() argument
851 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
858 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
861 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
862 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
863 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
878 clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate(struct kunit *test) in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate() argument
880 struct clk_multiple_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
887 kunit_skip(test, "This needs to be fixed in the core."); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
892 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
895 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
898 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
899 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
900 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
940 static int clk_single_parent_mux_test_init(struct kunit *test) in clk_single_parent_mux_test_init() argument
945 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_single_parent_mux_test_init()
948 test->priv = ctx; in clk_single_parent_mux_test_init()
972 clk_single_parent_mux_test_exit(struct kunit *test) in clk_single_parent_mux_test_exit() argument
974 struct clk_single_parent_ctx *ctx = test->priv; in clk_single_parent_mux_test_exit()
985 clk_test_single_parent_mux_get_parent(struct kunit *test) in clk_test_single_parent_mux_get_parent() argument
987 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_single_parent_mux_get_parent()
992 KUNIT_EXPECT_TRUE(test, clk_is_match(clk_get_parent(clk), parent)); in clk_test_single_parent_mux_get_parent()
1003 clk_test_single_parent_mux_has_parent(struct kunit *test) in clk_test_single_parent_mux_has_parent() argument
1005 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_single_parent_mux_has_parent()
1010 KUNIT_EXPECT_TRUE(test, clk_has_parent(clk, parent)); in clk_test_single_parent_mux_has_parent()
1026 clk_test_single_parent_mux_set_range_disjoint_child_last(struct kunit *test) in clk_test_single_parent_mux_set_range_disjoint_child_last() argument
1028 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_single_parent_mux_set_range_disjoint_child_last()
1034 kunit_skip(test, "This needs to be fixed in the core."); in clk_test_single_parent_mux_set_range_disjoint_child_last()
1037 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_disjoint_child_last()
1040 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_single_parent_mux_set_range_disjoint_child_last()
1043 KUNIT_EXPECT_LT(test, ret, 0); in clk_test_single_parent_mux_set_range_disjoint_child_last()
1058 clk_test_single_parent_mux_set_range_disjoint_parent_last(struct kunit *test) in clk_test_single_parent_mux_set_range_disjoint_parent_last() argument
1060 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1066 kunit_skip(test, "This needs to be fixed in the core."); in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1069 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1072 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1075 KUNIT_EXPECT_LT(test, ret, 0); in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1087 clk_test_single_parent_mux_set_range_round_rate_parent_only(struct kunit *test) in clk_test_single_parent_mux_set_range_round_rate_parent_only() argument
1089 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1097 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1100 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1103 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1104 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1105 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1117 clk_test_single_parent_mux_set_range_round_rate_child_smaller(struct kunit *test) in clk_test_single_parent_mux_set_range_round_rate_child_smaller() argument
1119 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1127 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1130 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1133 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1136 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1137 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1138 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1141 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1142 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1143 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1155 clk_test_single_parent_mux_set_range_round_rate_parent_smaller(struct kunit *test) in clk_test_single_parent_mux_set_range_round_rate_parent_smaller() argument
1157 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1165 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1168 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1171 KUNIT_ASSERT_EQ(test, ret, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1174 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1175 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1176 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1179 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1180 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1181 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1212 static int clk_orphan_transparent_single_parent_mux_test_init(struct kunit *test) in clk_orphan_transparent_single_parent_mux_test_init() argument
1219 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_orphan_transparent_single_parent_mux_test_init()
1222 test->priv = ctx; in clk_orphan_transparent_single_parent_mux_test_init()
1255 static void clk_test_orphan_transparent_parent_mux_set_range(struct kunit *test) in clk_test_orphan_transparent_parent_mux_set_range() argument
1257 struct clk_single_parent_ctx *ctx = test->priv; in clk_test_orphan_transparent_parent_mux_set_range()
1263 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_parent_mux_set_range()
1265 KUNIT_ASSERT_EQ(test, in clk_test_orphan_transparent_parent_mux_set_range()
1272 KUNIT_ASSERT_GT(test, new_rate, 0); in clk_test_orphan_transparent_parent_mux_set_range()
1273 KUNIT_EXPECT_EQ(test, rate, new_rate); in clk_test_orphan_transparent_parent_mux_set_range()
1305 clk_orphan_two_level_root_last_test_init(struct kunit *test) in clk_orphan_two_level_root_last_test_init() argument
1310 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_orphan_two_level_root_last_test_init()
1313 test->priv = ctx; in clk_orphan_two_level_root_last_test_init()
1345 clk_orphan_two_level_root_last_test_exit(struct kunit *test) in clk_orphan_two_level_root_last_test_exit() argument
1347 struct clk_single_parent_two_lvl_ctx *ctx = test->priv; in clk_orphan_two_level_root_last_test_exit()
1359 clk_orphan_two_level_root_last_test_get_rate(struct kunit *test) in clk_orphan_two_level_root_last_test_get_rate() argument
1361 struct clk_single_parent_two_lvl_ctx *ctx = test->priv; in clk_orphan_two_level_root_last_test_get_rate()
1367 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); in clk_orphan_two_level_root_last_test_get_rate()
1381 clk_orphan_two_level_root_last_test_set_range(struct kunit *test) in clk_orphan_two_level_root_last_test_set_range() argument
1383 struct clk_single_parent_two_lvl_ctx *ctx = test->priv; in clk_orphan_two_level_root_last_test_set_range()
1392 KUNIT_ASSERT_EQ(test, ret, 0); in clk_orphan_two_level_root_last_test_set_range()
1395 KUNIT_ASSERT_GT(test, rate, 0); in clk_orphan_two_level_root_last_test_set_range()
1396 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); in clk_orphan_two_level_root_last_test_set_range()
1433 static void clk_range_test_set_range(struct kunit *test) in clk_range_test_set_range() argument
1435 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range()
1440 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range()
1447 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range()
1448 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range()
1449 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range()
1458 static void clk_range_test_set_range_invalid(struct kunit *test) in clk_range_test_set_range_invalid() argument
1460 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_invalid()
1464 KUNIT_EXPECT_LT(test, in clk_range_test_set_range_invalid()
1477 static void clk_range_test_multiple_disjoints_range(struct kunit *test) in clk_range_test_multiple_disjoints_range() argument
1479 struct clk_dummy_context *ctx = test->priv; in clk_range_test_multiple_disjoints_range()
1484 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user1); in clk_range_test_multiple_disjoints_range()
1487 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user2); in clk_range_test_multiple_disjoints_range()
1489 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_disjoints_range()
1493 KUNIT_EXPECT_LT(test, in clk_range_test_multiple_disjoints_range()
1505 static void clk_range_test_set_range_round_rate_lower(struct kunit *test) in clk_range_test_set_range_round_rate_lower() argument
1507 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_round_rate_lower()
1512 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_round_rate_lower()
1519 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_round_rate_lower()
1520 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_round_rate_lower()
1521 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_round_rate_lower()
1530 static void clk_range_test_set_range_set_rate_lower(struct kunit *test) in clk_range_test_set_range_set_rate_lower() argument
1532 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_set_rate_lower()
1537 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_rate_lower()
1543 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_rate_lower()
1548 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_set_rate_lower()
1549 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_set_rate_lower()
1550 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_set_rate_lower()
1561 static void clk_range_test_set_range_set_round_rate_consistent_lower(struct kunit *test) in clk_range_test_set_range_set_round_rate_consistent_lower() argument
1563 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_set_round_rate_consistent_lower()
1568 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_round_rate_consistent_lower()
1575 KUNIT_ASSERT_GT(test, rounded, 0); in clk_range_test_set_range_set_round_rate_consistent_lower()
1577 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_round_rate_consistent_lower()
1581 KUNIT_EXPECT_EQ(test, rounded, clk_get_rate(clk)); in clk_range_test_set_range_set_round_rate_consistent_lower()
1590 static void clk_range_test_set_range_round_rate_higher(struct kunit *test) in clk_range_test_set_range_round_rate_higher() argument
1592 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_round_rate_higher()
1597 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_round_rate_higher()
1604 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_round_rate_higher()
1605 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_round_rate_higher()
1606 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_round_rate_higher()
1615 static void clk_range_test_set_range_set_rate_higher(struct kunit *test) in clk_range_test_set_range_set_rate_higher() argument
1617 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_set_rate_higher()
1622 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_rate_higher()
1628 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_rate_higher()
1633 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_set_rate_higher()
1634 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_set_rate_higher()
1635 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_set_rate_higher()
1646 static void clk_range_test_set_range_set_round_rate_consistent_higher(struct kunit *test) in clk_range_test_set_range_set_round_rate_consistent_higher() argument
1648 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_set_round_rate_consistent_higher()
1653 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_round_rate_consistent_higher()
1660 KUNIT_ASSERT_GT(test, rounded, 0); in clk_range_test_set_range_set_round_rate_consistent_higher()
1662 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_set_round_rate_consistent_higher()
1666 KUNIT_EXPECT_EQ(test, rounded, clk_get_rate(clk)); in clk_range_test_set_range_set_round_rate_consistent_higher()
1679 static void clk_range_test_set_range_get_rate_raised(struct kunit *test) in clk_range_test_set_range_get_rate_raised() argument
1681 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_get_rate_raised()
1686 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_get_rate_raised()
1690 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_get_rate_raised()
1697 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_get_rate_raised()
1698 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_get_rate_raised()
1711 static void clk_range_test_set_range_get_rate_lowered(struct kunit *test) in clk_range_test_set_range_get_rate_lowered() argument
1713 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_get_rate_lowered()
1718 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_get_rate_lowered()
1722 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_get_rate_lowered()
1729 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_get_rate_lowered()
1730 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_get_rate_lowered()
1771 static void clk_range_test_set_range_rate_maximized(struct kunit *test) in clk_range_test_set_range_rate_maximized() argument
1773 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_rate_maximized()
1778 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_maximized()
1782 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_maximized()
1789 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_maximized()
1790 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_rate_maximized()
1792 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_maximized()
1799 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_maximized()
1800 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_range_test_set_range_rate_maximized()
1802 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_maximized()
1809 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_maximized()
1810 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_rate_maximized()
1823 static void clk_range_test_multiple_set_range_rate_maximized(struct kunit *test) in clk_range_test_multiple_set_range_rate_maximized() argument
1825 struct clk_dummy_context *ctx = test->priv; in clk_range_test_multiple_set_range_rate_maximized()
1832 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user1); in clk_range_test_multiple_set_range_rate_maximized()
1835 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user2); in clk_range_test_multiple_set_range_rate_maximized()
1837 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_maximized()
1841 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_maximized()
1848 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_maximized()
1849 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_maximized()
1851 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_maximized()
1858 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_maximized()
1859 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_maximized()
1861 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_maximized()
1866 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_maximized()
1867 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_maximized()
1882 static void clk_range_test_multiple_set_range_rate_put_maximized(struct kunit *test) in clk_range_test_multiple_set_range_rate_put_maximized() argument
1884 struct clk_dummy_context *ctx = test->priv; in clk_range_test_multiple_set_range_rate_put_maximized()
1891 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user1); in clk_range_test_multiple_set_range_rate_put_maximized()
1894 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user2); in clk_range_test_multiple_set_range_rate_put_maximized()
1896 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_put_maximized()
1900 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_put_maximized()
1907 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_maximized()
1908 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_put_maximized()
1910 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_put_maximized()
1917 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_maximized()
1918 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_put_maximized()
1923 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_maximized()
1924 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_put_maximized()
1959 static void clk_range_test_set_range_rate_minimized(struct kunit *test) in clk_range_test_set_range_rate_minimized() argument
1961 struct clk_dummy_context *ctx = test->priv; in clk_range_test_set_range_rate_minimized()
1966 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_minimized()
1970 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_minimized()
1977 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_minimized()
1978 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_rate_minimized()
1980 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_minimized()
1987 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_minimized()
1988 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_range_test_set_range_rate_minimized()
1990 KUNIT_ASSERT_EQ(test, in clk_range_test_set_range_rate_minimized()
1997 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_minimized()
1998 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_rate_minimized()
2011 static void clk_range_test_multiple_set_range_rate_minimized(struct kunit *test) in clk_range_test_multiple_set_range_rate_minimized() argument
2013 struct clk_dummy_context *ctx = test->priv; in clk_range_test_multiple_set_range_rate_minimized()
2020 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user1); in clk_range_test_multiple_set_range_rate_minimized()
2023 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user2); in clk_range_test_multiple_set_range_rate_minimized()
2025 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_minimized()
2032 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_minimized()
2033 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_minimized()
2035 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_minimized()
2042 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_minimized()
2043 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_minimized()
2045 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_minimized()
2050 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_minimized()
2051 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_minimized()
2066 static void clk_range_test_multiple_set_range_rate_put_minimized(struct kunit *test) in clk_range_test_multiple_set_range_rate_put_minimized() argument
2068 struct clk_dummy_context *ctx = test->priv; in clk_range_test_multiple_set_range_rate_put_minimized()
2075 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user1); in clk_range_test_multiple_set_range_rate_put_minimized()
2078 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user2); in clk_range_test_multiple_set_range_rate_put_minimized()
2080 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_put_minimized()
2087 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_minimized()
2088 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_put_minimized()
2090 KUNIT_ASSERT_EQ(test, in clk_range_test_multiple_set_range_rate_put_minimized()
2097 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_minimized()
2098 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_put_minimized()
2103 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_minimized()
2104 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_put_minimized()
2137 clk_leaf_mux_set_rate_parent_test_init(struct kunit *test) in clk_leaf_mux_set_rate_parent_test_init() argument
2143 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_leaf_mux_set_rate_parent_test_init()
2146 test->priv = ctx; in clk_leaf_mux_set_rate_parent_test_init()
2182 static void clk_leaf_mux_set_rate_parent_test_exit(struct kunit *test) in clk_leaf_mux_set_rate_parent_test_exit() argument
2184 struct clk_leaf_mux_ctx *ctx = test->priv; in clk_leaf_mux_set_rate_parent_test_exit()
2197 static void clk_leaf_mux_set_rate_parent_determine_rate(struct kunit *test) in clk_leaf_mux_set_rate_parent_determine_rate() argument
2199 struct clk_leaf_mux_ctx *ctx = test->priv; in clk_leaf_mux_set_rate_parent_determine_rate()
2207 KUNIT_ASSERT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_leaf_mux_set_rate_parent_determine_rate()
2212 KUNIT_ASSERT_EQ(test, ret, 0); in clk_leaf_mux_set_rate_parent_determine_rate()
2214 KUNIT_EXPECT_EQ(test, req.rate, DUMMY_CLOCK_RATE_2); in clk_leaf_mux_set_rate_parent_determine_rate()
2215 KUNIT_EXPECT_EQ(test, req.best_parent_rate, DUMMY_CLOCK_RATE_2); in clk_leaf_mux_set_rate_parent_determine_rate()
2216 KUNIT_EXPECT_PTR_EQ(test, req.best_parent_hw, &ctx->mux_ctx.hw); in clk_leaf_mux_set_rate_parent_determine_rate()
2284 static int clk_mux_notifier_test_init(struct kunit *test) in clk_mux_notifier_test_init() argument
2290 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in clk_mux_notifier_test_init()
2293 test->priv = ctx; in clk_mux_notifier_test_init()
2330 static void clk_mux_notifier_test_exit(struct kunit *test) in clk_mux_notifier_test_exit() argument
2332 struct clk_mux_notifier_ctx *ctx = test->priv; in clk_mux_notifier_test_exit()
2348 static void clk_mux_notifier_set_parent_test(struct kunit *test) in clk_mux_notifier_set_parent_test() argument
2350 struct clk_mux_notifier_ctx *ctx = test->priv; in clk_mux_notifier_set_parent_test()
2357 KUNIT_ASSERT_EQ(test, ret, 0); in clk_mux_notifier_set_parent_test()
2362 KUNIT_ASSERT_GT(test, ret, 0); in clk_mux_notifier_set_parent_test()
2364 KUNIT_EXPECT_EQ(test, ctx->pre_rate_change.old_rate, DUMMY_CLOCK_RATE_1); in clk_mux_notifier_set_parent_test()
2365 KUNIT_EXPECT_EQ(test, ctx->pre_rate_change.new_rate, DUMMY_CLOCK_RATE_2); in clk_mux_notifier_set_parent_test()
2370 KUNIT_ASSERT_GT(test, ret, 0); in clk_mux_notifier_set_parent_test()
2372 KUNIT_EXPECT_EQ(test, ctx->post_rate_change.old_rate, DUMMY_CLOCK_RATE_1); in clk_mux_notifier_set_parent_test()
2373 KUNIT_EXPECT_EQ(test, ctx->post_rate_change.new_rate, DUMMY_CLOCK_RATE_2); in clk_mux_notifier_set_parent_test()