Lines Matching full:parent
128 * between rates above the parent rate which would be rounded to
129 * what the parent can provide, but rates below will simply
328 * Test suite for a basic rate clock, without any parent.
449 * Test suite for a basic, uncached, rate clock, without any parent.
464 const char *parents[2] = { "parent-0", "parent-1"}; in clk_multiple_parents_mux_test_init()
472 ctx->parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0", in clk_multiple_parents_mux_test_init()
480 ctx->parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1", in clk_multiple_parents_mux_test_init()
509 struct clk *parent = clk_hw_get_clk(&ctx->parents_ctx[0].hw, NULL); in clk_test_multiple_parents_mux_get_parent() local
511 KUNIT_EXPECT_TRUE(test, clk_is_match(clk_get_parent(clk), parent)); in clk_test_multiple_parents_mux_get_parent()
513 clk_put(parent); in clk_test_multiple_parents_mux_get_parent()
527 struct clk *parent; in clk_test_multiple_parents_mux_has_parent() local
529 parent = clk_hw_get_clk(&ctx->parents_ctx[0].hw, NULL); in clk_test_multiple_parents_mux_has_parent()
530 KUNIT_EXPECT_TRUE(test, clk_has_parent(clk, parent)); in clk_test_multiple_parents_mux_has_parent()
531 clk_put(parent); in clk_test_multiple_parents_mux_has_parent()
533 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL); in clk_test_multiple_parents_mux_has_parent()
534 KUNIT_EXPECT_TRUE(test, clk_has_parent(clk, parent)); in clk_test_multiple_parents_mux_has_parent()
535 clk_put(parent); in clk_test_multiple_parents_mux_has_parent()
542 * that clock and the parent is changed, its rate after the reparenting
613 const char *parents[2] = { "missing-parent", "proper-parent"}; in clk_orphan_transparent_multiple_parent_mux_test_init()
621 ctx->parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("proper-parent", in clk_orphan_transparent_multiple_parent_mux_test_init()
640 * Test that, for a mux whose current parent hasn't been registered yet and is
656 * Test that, for a mux whose current parent hasn't been registered yet,
657 * calling clk_set_parent() to a valid parent will properly update the
658 * mux parent and its orphan status.
666 struct clk *parent, *new_parent; in clk_test_orphan_transparent_multiple_parent_mux_set_parent() local
669 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
670 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
672 ret = clk_set_parent(clk, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
676 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
677 KUNIT_EXPECT_TRUE(test, clk_is_match(parent, new_parent)); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
679 clk_put(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent()
685 * parent, calling clk_drop_range() on the mux won't affect the parent
694 struct clk *parent; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range() local
698 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
699 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
701 parent_rate = clk_get_rate(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
704 ret = clk_set_parent(clk, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
714 clk_put(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_drop_range()
720 * parent, the rate of the mux and its new parent are consistent.
728 struct clk *parent; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate() local
732 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
733 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
735 parent_rate = clk_get_rate(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
738 ret = clk_set_parent(clk, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
745 clk_put(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
751 * parent, calling clk_put() on the mux won't affect the parent rate.
757 struct clk *clk, *parent; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put() local
761 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
762 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
767 parent_rate = clk_get_rate(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
770 ret = clk_set_parent(clk, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
775 new_parent_rate = clk_get_rate(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
779 clk_put(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_put()
784 * parent, calling clk_set_rate_range() will affect the parent state if
793 struct clk *parent; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified() local
797 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
798 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
800 ret = clk_set_parent(clk, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
811 clk_put(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
817 * parent, calling clk_set_rate_range() won't affect the parent state if
826 struct clk *parent; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched() local
830 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
831 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
833 parent_rate = clk_get_rate(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
836 ret = clk_set_parent(clk, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
844 new_parent_rate = clk_get_rate(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
848 clk_put(parent); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_untouched()
853 * Test that, for a mux whose current parent hasn't been registered yet,
879 * then got switched to a valid parent, its rate is eventually within
892 struct clk *parent; in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate() local
900 parent = clk_hw_get_clk_kunit(test, &ctx->parents_ctx[1].hw, NULL); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
901 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
903 ret = clk_set_parent(clk, parent); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
926 * Test suite for a basic mux clock with two parents. The default parent
927 * isn't registered, only the second parent is. By default, the clock
932 * parent.
935 .name = "clk-orphan-transparent-multiple-parent-mux-test",
957 CLK_HW_INIT_NO_PARENT("parent-clk", in clk_single_parent_mux_test_init()
965 ctx->hw.init = CLK_HW_INIT("test-clk", "parent-clk", in clk_single_parent_mux_test_init()
986 * Test that for a clock with a single parent, clk_get_parent() actually
987 * returns the parent.
995 struct clk *parent = clk_hw_get_clk(&ctx->parent_ctx.hw, NULL); in clk_test_single_parent_mux_get_parent() local
997 KUNIT_EXPECT_TRUE(test, clk_is_match(clk_get_parent(clk), parent)); in clk_test_single_parent_mux_get_parent()
999 clk_put(parent); in clk_test_single_parent_mux_get_parent()
1004 * Test that for a clock with a single parent, clk_has_parent() actually
1005 * reports it as a parent.
1013 struct clk *parent = clk_hw_get_clk(&ctx->parent_ctx.hw, NULL); in clk_test_single_parent_mux_has_parent() local
1015 KUNIT_EXPECT_TRUE(test, clk_has_parent(clk, parent)); in clk_test_single_parent_mux_has_parent()
1017 clk_put(parent); in clk_test_single_parent_mux_has_parent()
1023 * parent, if we set disjoints range on the parent and then the child,
1036 struct clk *parent; in clk_test_single_parent_mux_set_range_disjoint_child_last() local
1041 parent = clk_get_parent(clk); in clk_test_single_parent_mux_set_range_disjoint_child_last()
1042 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_disjoint_child_last()
1044 ret = clk_set_rate_range(parent, 1000, 2000); in clk_test_single_parent_mux_set_range_disjoint_child_last()
1053 * parent, if we set disjoints range on the child and then the parent,
1066 struct clk *parent; in clk_test_single_parent_mux_set_range_disjoint_parent_last() local
1071 parent = clk_get_parent(clk); in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1072 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1077 ret = clk_set_rate_range(parent, 3000, 4000); in clk_test_single_parent_mux_set_range_disjoint_parent_last()
1083 * parent, if we set a range on the parent and then call
1084 * clk_round_rate(), the boundaries of the parent are taken into
1093 struct clk *parent; in clk_test_single_parent_mux_set_range_round_rate_parent_only() local
1097 parent = clk_get_parent(clk); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1098 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1100 ret = clk_set_rate_range(parent, DUMMY_CLOCK_RATE_1, DUMMY_CLOCK_RATE_2); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1113 * parent, if we set a range on the parent and a more restrictive one on
1123 struct clk *parent; in clk_test_single_parent_mux_set_range_round_rate_child_smaller() local
1127 parent = clk_get_parent(clk); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1128 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1130 ret = clk_set_rate_range(parent, DUMMY_CLOCK_RATE_1, DUMMY_CLOCK_RATE_2); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1151 * parent, if we set a range on the child and a more restrictive one on
1152 * the parent, and then call clk_round_rate(), the boundaries of the
1161 struct clk *parent; in clk_test_single_parent_mux_set_range_round_rate_parent_smaller() local
1165 parent = clk_get_parent(clk); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1166 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1168 ret = clk_set_rate_range(parent, DUMMY_CLOCK_RATE_1 + 1000, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1199 * Test suite for a basic mux clock with one parent, with
1203 * child and parent are sane and consistent.
1207 .name = "clk-single-parent-mux-test",
1284 * Test suite for a basic mux clock with one parent. The parent is
1292 .name = "clk-orphan-transparent-single-parent-test",
1316 CLK_HW_INIT("intermediate-parent", in clk_orphan_two_level_root_last_test_init()
1317 "root-parent", in clk_orphan_two_level_root_last_test_init()
1325 CLK_HW_INIT("test-clk", "intermediate-parent", in clk_orphan_two_level_root_last_test_init()
1334 CLK_HW_INIT_NO_PARENT("root-parent", in clk_orphan_two_level_root_last_test_init()
1355 * Test that, for a clock whose parent used to be orphan, clk_get_rate()
1373 * Test that, for a clock whose parent used to be orphan,
1409 * Test suite for a basic, transparent, clock with a parent that is also
1410 * such a clock. The parent's parent is registered last, while the
1411 * parent and its child are registered in that order. The intermediate
1413 * clock itself will always have its parent and will never be
1414 * reparented. Indeed, it's only orphan because its parent is.
1418 * parent.
1751 * Test suite for a basic rate clock, without any parent.
1938 * Test suite for a basic rate clock, without any parent.
2118 * Test suite for a basic rate clock, without any parent.
2134 struct clk_hw parent; member
2165 const char *top_parents[2] = { "parent-0", "parent-1" }; in clk_leaf_mux_set_rate_parent_test_init()
2173 ctx->mux_ctx.parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0", in clk_leaf_mux_set_rate_parent_test_init()
2181 ctx->mux_ctx.parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1", in clk_leaf_mux_set_rate_parent_test_init()
2197 ctx->parent.init = CLK_HW_INIT_HW("test-parent", &ctx->mux_ctx.hw, in clk_leaf_mux_set_rate_parent_test_init()
2199 ret = clk_hw_register(NULL, &ctx->parent); in clk_leaf_mux_set_rate_parent_test_init()
2203 ctx->hw.init = CLK_HW_INIT_HW("test-clock", &ctx->parent, in clk_leaf_mux_set_rate_parent_test_init()
2218 clk_hw_unregister(&ctx->parent); in clk_leaf_mux_set_rate_parent_test_exit()
2240 * Test that __clk_determine_rate() on the parent that can't
2242 * the best_parent_hw pointer pointing to the parent.
2249 * Test that __clk_mux_determine_rate() on the parent that
2252 * the parent.
2259 * Test that __clk_mux_determine_rate_closest() on the parent
2262 * the parent.
2269 * Test that clk_hw_determine_rate_no_reparent() on the parent
2272 * the parent.
2285 * __clk_determine_rate() on its parent it doesn't get back a clk_rate_request in KUNIT_ARRAY_PARAM()
2288 * forwarding clk_rate_requests to the parent") for more background. in KUNIT_ARRAY_PARAM()
2321 * Test suite for a clock whose parent is a pass-through clk whose parent is a
2324 * will then select which parent is the best fit for a given rate.
2330 .name = "clk-leaf-mux-set-rate-parent",
2381 const char *top_parents[2] = { "parent-0", "parent-1" }; in clk_mux_notifier_test_init()
2392 ctx->mux_ctx.parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0", in clk_mux_notifier_test_init()
2400 ctx->mux_ctx.parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1", in clk_mux_notifier_test_init()
2439 * will notify us when we switch to another parent, and with the proper
2495 const char *parents[2] = { "parent-0", "parent-1"}; in clk_mux_no_reparent_test_init()
2503 ctx->parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0", in clk_mux_no_reparent_test_init()
2511 ctx->parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1", in clk_mux_no_reparent_test_init()
2541 * Test that if the we have a mux that cannot change parent and we call
2543 * parent, it won't.
2550 struct clk *other_parent, *parent; in clk_mux_no_reparent_round_rate() local
2555 parent = clk_get_parent(clk); in clk_mux_no_reparent_round_rate()
2556 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_mux_no_reparent_round_rate()
2558 parent_rate = clk_get_rate(parent); in clk_mux_no_reparent_round_rate()
2563 KUNIT_ASSERT_FALSE(test, clk_is_match(parent, other_parent)); in clk_mux_no_reparent_round_rate()
2577 * Test that if the we have a mux that cannot change parent and we call
2579 * parent, it won't.
2586 struct clk *other_parent, *parent; in clk_mux_no_reparent_set_rate() local
2592 parent = clk_get_parent(clk); in clk_mux_no_reparent_set_rate()
2593 KUNIT_ASSERT_PTR_NE(test, parent, NULL); in clk_mux_no_reparent_set_rate()
2595 parent_rate = clk_get_rate(parent); in clk_mux_no_reparent_set_rate()
2600 KUNIT_ASSERT_FALSE(test, clk_is_match(parent, other_parent)); in clk_mux_no_reparent_set_rate()
2623 * Test suite for a clock mux that isn't allowed to change parent, using
2653 * find a parent based on struct clk_parent_data::index.
2661 * find a parent based on struct clk_parent_data::fwname.
2669 * find a parent based on struct clk_parent_data::name.
2679 * find a parent based on struct
2689 * find a parent based on struct clk_parent_data::{index,name}.
2699 * find a parent based on struct
2735 ctx->np = of_find_compatible_node(NULL, NULL, "test,clk-parent-data"); in clk_register_clk_parent_data_of_test_init()
2745 * Test that a clk registered with a struct device_node can find a parent based on
2827 { .compatible = "test,clk-parent-data" }, in clk_register_clk_parent_data_device_driver()
2845 * parent based on struct clk_parent_data::index.
2853 * parent based on struct clk_parent_data::fwname.
2861 * parent based on struct clk_parent_data::name.
2871 * parent based on struct clk_parent_data::{fw_name,name}.
2880 * parent based on struct clk_parent_data::{index,name}. Index
2890 * parent based on struct clk_parent_data::{index,fwname,name}.
2905 * Test that a clk registered with a struct device can find a parent based on in KUNIT_ARRAY_PARAM()
2947 * parent based on struct clk_parent_data::hw.
2956 * parent based on struct clk_parent_data::hw when
2965 * parent based on struct clk_parent_data::hw when struct
2976 * parent based on struct clk_parent_data::hw when struct
2986 * parent based on struct clk_parent_data::hw when struct
2996 * parent based on struct clk_parent_data::hw when
3013 * parent based on struct clk_parent_data::hw. in KUNIT_ARRAY_PARAM()
3019 struct clk_dummy_context *parent; in KUNIT_ARRAY_PARAM() local
3030 parent = kunit_kzalloc(test, sizeof(*parent), GFP_KERNEL); in KUNIT_ARRAY_PARAM()
3031 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); in KUNIT_ARRAY_PARAM()
3033 parent_hw = &parent->hw; in KUNIT_ARRAY_PARAM()
3034 parent_hw->init = CLK_HW_INIT_NO_PARENT("parent-clk", in KUNIT_ARRAY_PARAM()