Lines Matching full:rate
28 unsigned long rate; member
37 return ctx->rate; in clk_dummy_recalc_rate()
43 /* Just return the same rate without modifying it */ in clk_dummy_determine_rate()
55 req->rate = req->max_rate; in clk_dummy_maximize_rate()
68 req->rate = req->min_rate; in clk_dummy_minimize_rate()
74 unsigned long rate, in clk_dummy_set_rate() argument
80 ctx->rate = rate; in clk_dummy_set_rate()
119 * clk_round_rate() or clk_set_rate() with a rate lower than
123 * behaviour to always pick up the closest rate higher than the
124 * requested rate. If we get something lower, it thus considers
128 * between rates above the parent rate which would be rounded to
185 ctx->rate = DUMMY_CLOCK_INIT_RATE; in clk_test_init_with_ops()
222 * Test that the actual rate matches what is returned by clk_get_rate()
229 unsigned long rate; in clk_test_get_rate() local
231 rate = clk_get_rate(clk); in clk_test_get_rate()
232 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_get_rate()
233 KUNIT_EXPECT_EQ(test, rate, ctx->rate); in clk_test_get_rate()
239 * Test that, after a call to clk_set_rate(), the rate returned by
243 * modify the requested rate, which is our case in clk_dummy_rate_ops.
250 unsigned long rate; in clk_test_set_get_rate() local
256 rate = clk_get_rate(clk); in clk_test_set_get_rate()
257 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_set_get_rate()
258 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_set_get_rate()
264 * Test that, after several calls to clk_set_rate(), the rate returned
268 * modify the requested rate, which is our case in clk_dummy_rate_ops.
275 unsigned long rate; in clk_test_set_set_get_rate() local
285 rate = clk_get_rate(clk); in clk_test_set_set_get_rate()
286 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_set_set_get_rate()
287 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_set_set_get_rate()
328 * Test suite for a basic rate clock, without any parent.
330 * These tests exercise the rate API with simple scenarios
349 ctx->rate = DUMMY_CLOCK_INIT_RATE; in clk_uncached_test_init()
363 * the rate and clk_get_rate() will return the underlying clock rate
371 unsigned long rate; in clk_test_uncached_get_rate() local
373 rate = clk_get_rate(clk); in clk_test_uncached_get_rate()
374 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_get_rate()
375 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); in clk_test_uncached_get_rate()
377 /* We change the rate behind the clock framework's back */ in clk_test_uncached_get_rate()
378 ctx->rate = DUMMY_CLOCK_RATE_1; in clk_test_uncached_get_rate()
379 rate = clk_get_rate(clk); in clk_test_uncached_get_rate()
380 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_get_rate()
381 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_uncached_get_rate()
388 * properly if the rate hasn't changed.
395 unsigned long rate; in clk_test_uncached_set_range() local
403 rate = clk_get_rate(clk); in clk_test_uncached_set_range()
404 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_set_range()
405 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_uncached_set_range()
406 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_uncached_set_range()
413 * properly if the rate has changed in hardware.
415 * In this case, it means that if the rate wasn't initially in the range
417 * without the kernel knowing about it, its rate shouldn't be affected.
424 unsigned long rate; in clk_test_uncached_updated_rate_set_range() local
426 /* We change the rate behind the clock framework's back */ in clk_test_uncached_updated_rate_set_range()
427 ctx->rate = DUMMY_CLOCK_RATE_1 + 1000; in clk_test_uncached_updated_rate_set_range()
434 rate = clk_get_rate(clk); in clk_test_uncached_updated_rate_set_range()
435 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_updated_rate_set_range()
436 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_uncached_updated_rate_set_range()
449 * Test suite for a basic, uncached, rate clock, without any parent.
451 * These tests exercise the rate API with simple scenarios
475 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_multiple_parents_mux_test_init()
483 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_multiple_parents_mux_test_init()
542 * that clock and the parent is changed, its rate after the reparenting
546 * reevaluate whether the new clock rate is within its boundaries or
556 unsigned long rate; in clk_test_multiple_parents_mux_set_range_set_parent_get_rate() local
582 rate = clk_get_rate(clk); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
583 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
584 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
585 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
624 ctx->parents_ctx[1].rate = DUMMY_CLOCK_INIT_RATE; in clk_orphan_transparent_multiple_parent_mux_test_init()
686 * rate.
720 * parent, the rate of the mux and its new parent are consistent.
729 unsigned long parent_rate, rate; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate() local
741 rate = clk_get_rate(clk); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
742 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
743 KUNIT_EXPECT_EQ(test, parent_rate, rate); 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.
785 * its rate is out of range.
794 unsigned long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified() local
806 rate = clk_get_rate(clk); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
807 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
808 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
809 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
818 * its rate is within range.
855 * account when rounding a rate.
863 long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate() local
869 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
870 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
871 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
872 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
878 * Test that, for a mux that started orphan, was assigned and rate and
879 * then got switched to a valid parent, its rate is eventually within
882 * FIXME: Even though we update the rate as part of clk_set_parent(), we
883 * don't evaluate whether that new rate is within range and needs to be
893 unsigned long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate() local
906 rate = clk_get_rate(clk); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
907 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
908 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
909 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
955 ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; in clk_single_parent_mux_test_init()
1022 * Test that for a clock that can't modify its rate and with a single
1052 * Test that for a clock that can't modify its rate and with a single
1082 * Test that for a clock that can't modify its rate and with a single
1094 long rate; in clk_test_single_parent_mux_set_range_round_rate_parent_only() local
1103 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1104 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1105 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1106 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1112 * Test that for a clock that can't modify its rate and with a single
1124 long rate; in clk_test_single_parent_mux_set_range_round_rate_child_smaller() local
1136 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1137 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1138 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1139 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1141 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_2 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1142 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1143 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1144 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1150 * Test that for a clock that can't modify its rate and with a single
1162 long rate; in clk_test_single_parent_mux_set_range_round_rate_parent_smaller() local
1174 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1175 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1176 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1177 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1179 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_2 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1180 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1181 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1182 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1239 ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; in clk_orphan_transparent_single_parent_mux_test_init()
1249 * Test that a mux-only clock, with an initial rate within a range,
1250 * will still have the same rate after the range has been enforced.
1260 unsigned long rate, new_rate; in clk_test_orphan_transparent_parent_mux_set_range() local
1262 rate = clk_get_rate(clk); 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()
1267 ctx->parent_ctx.rate - 1000, in clk_test_orphan_transparent_parent_mux_set_range()
1268 ctx->parent_ctx.rate + 1000), 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()
1332 ctx->parent_parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; in clk_orphan_two_level_root_last_test_init()
1356 * will return the proper rate.
1364 unsigned long rate; in clk_orphan_two_level_root_last_test_get_rate() local
1366 rate = clk_get_rate(clk); 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()
1374 * clk_set_rate_range() won't affect its rate if it is already within
1386 unsigned long rate; in clk_orphan_two_level_root_last_test_set_range() local
1394 rate = clk_get_rate(clk); 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()
1430 * and that it will make sure the rate of the clock is within the
1438 unsigned long rate; in clk_range_test_set_range() local
1446 rate = clk_get_rate(clk); 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()
1455 * Test that calling clk_set_rate_range with a minimum rate higher than
1456 * the maximum rate returns an error.
1502 * Test that if our clock has some boundaries and we try to round a rate
1503 * lower than the minimum, the returned rate will be within range.
1510 long rate; in clk_range_test_set_range_round_rate_lower() local
1518 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); 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()
1527 * Test that if our clock has some boundaries and we try to set a rate
1528 * higher than the maximum, the new rate will be within range.
1535 unsigned long rate; in clk_range_test_set_range_set_rate_lower() local
1547 rate = clk_get_rate(clk); 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()
1557 * set a rate lower than the minimum, the rate returned by
1558 * clk_round_rate() will be consistent with the new rate set by
1587 * Test that if our clock has some boundaries and we try to round a rate
1588 * higher than the maximum, the returned rate will be within range.
1595 long rate; in clk_range_test_set_range_round_rate_higher() local
1603 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_2 + 1000); 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()
1612 * Test that if our clock has some boundaries and we try to set a rate
1613 * higher than the maximum, the new rate will be within range.
1620 unsigned long rate; in clk_range_test_set_range_set_rate_higher() local
1632 rate = clk_get_rate(clk); 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()
1642 * set a rate higher than the maximum, the rate returned by
1643 * clk_round_rate() will be consistent with the new rate set by
1672 * Test that if our clock has a rate lower than the minimum set by a
1673 * call to clk_set_rate_range(), the rate will be raised to match the
1677 * modify the requested rate, which is our case in clk_dummy_rate_ops.
1684 unsigned long rate; in clk_range_test_set_range_get_rate_raised() local
1696 rate = clk_get_rate(clk); 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()
1704 * Test that if our clock has a rate higher than the maximum set by a
1705 * call to clk_set_rate_range(), the rate will be lowered to match the
1709 * modify the requested rate, which is our case in clk_dummy_rate_ops.
1716 unsigned long rate; in clk_range_test_set_range_get_rate_lowered() local
1728 rate = clk_get_rate(clk); 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()
1751 * Test suite for a basic rate clock, without any parent.
1753 * These tests exercise the rate range API: clk_set_rate_range(),
1765 * clk_set_rate_range(), the core will reevaluate whether a new rate is
1768 * With clk_dummy_maximize_rate_ops, this means that the rate will
1776 unsigned long rate; in clk_range_test_set_range_rate_maximized() local
1788 rate = clk_get_rate(clk); 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()
1798 rate = clk_get_rate(clk); 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()
1808 rate = clk_get_rate(clk); 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()
1818 * whether a new rate is needed each and every time.
1820 * With clk_dummy_maximize_rate_ops, this means that the rate will
1829 unsigned long rate; in clk_range_test_multiple_set_range_rate_maximized() local
1847 rate = clk_get_rate(clk); 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()
1857 rate = clk_get_rate(clk); 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()
1865 rate = clk_get_rate(clk); 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()
1877 * whether a new rate is needed, including when a user drop its clock.
1879 * With clk_dummy_maximize_rate_ops, this means that the rate will
1888 unsigned long rate; in clk_range_test_multiple_set_range_rate_put_maximized() local
1906 rate = clk_get_rate(clk); 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()
1916 rate = clk_get_rate(clk); 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()
1922 rate = clk_get_rate(clk); 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()
1938 * Test suite for a basic rate clock, without any parent.
1940 * These tests exercise the rate range API: clk_set_rate_range(),
1942 * driver that will always try to run at the highest possible rate.
1953 * clk_set_rate_range(), the core will reevaluate whether a new rate is
1956 * With clk_dummy_minimize_rate_ops, this means that the rate will
1964 unsigned long rate; in clk_range_test_set_range_rate_minimized() local
1976 rate = clk_get_rate(clk); 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()
1986 rate = clk_get_rate(clk); 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()
1996 rate = clk_get_rate(clk); 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()
2006 * whether a new rate is needed each and every time.
2008 * With clk_dummy_minimize_rate_ops, this means that the rate will
2017 unsigned long rate; in clk_range_test_multiple_set_range_rate_minimized() local
2031 rate = clk_get_rate(clk); 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()
2041 rate = clk_get_rate(clk); 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()
2049 rate = clk_get_rate(clk); 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()
2061 * whether a new rate is needed, including when a user drop its clock.
2063 * With clk_dummy_minimize_rate_ops, this means that the rate will
2072 unsigned long rate; in clk_range_test_multiple_set_range_rate_put_minimized() local
2086 rate = clk_get_rate(clk); 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()
2096 rate = clk_get_rate(clk); 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()
2102 rate = clk_get_rate(clk); 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()
2118 * Test suite for a basic rate clock, without any parent.
2120 * These tests exercise the rate range API: clk_set_rate_range(),
2122 * driver that will always try to run at the lowest possible rate.
2145 clk_hw_forward_rate_request(hw, req, req->best_parent_hw, parent_req, req->rate); in clk_leaf_mux_determine_rate()
2150 req->rate = parent_req->rate; in clk_leaf_mux_determine_rate()
2176 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_leaf_mux_set_rate_parent_test_init()
2184 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_leaf_mux_set_rate_parent_test_init()
2241 * change rate doesn't return a clk_rate_request structure with
2250 * can't change rate doesn't return a clk_rate_request
2260 * that can't change rate doesn't return a clk_rate_request
2270 * that can't change rate doesn't return a clk_rate_request
2284 * Test that when a clk that can't change rate itself calls a function like in KUNIT_ARRAY_PARAM()
2287 * into the determine rate function. See commit 262ca38f4b6e ("clk: Stop in KUNIT_ARRAY_PARAM()
2296 unsigned long rate; in KUNIT_ARRAY_PARAM() local
2303 rate = clk_get_rate(clk); in KUNIT_ARRAY_PARAM()
2304 KUNIT_ASSERT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in KUNIT_ARRAY_PARAM()
2307 KUNIT_EXPECT_EQ(test, req.rate, DUMMY_CLOCK_RATE_2); in KUNIT_ARRAY_PARAM()
2323 * CLK_SET_RATE_PARENT flag, and will forward rate requests to the mux, which
2324 * will then select which parent is the best fit for a given rate.
2330 .name = "clk-leaf-mux-set-rate-parent",
2395 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_mux_notifier_test_init()
2403 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_mux_notifier_test_init()
2506 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_mux_no_reparent_test_init()
2514 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_mux_no_reparent_test_init()
2542 * clk_round_rate() on it with a rate that should cause it to change
2578 * clk_set_rate() on it with a rate that should cause it to change
2589 unsigned long rate; in clk_mux_no_reparent_set_rate() local
2609 rate = clk_get_rate(clk); in clk_mux_no_reparent_set_rate()
2610 KUNIT_ASSERT_GT(test, rate, 0); in clk_mux_no_reparent_set_rate()
2611 KUNIT_EXPECT_EQ(test, rate, parent_rate); in clk_mux_no_reparent_set_rate()