Lines Matching full:rate
3 * Kunit test for clk rate management
19 unsigned long rate; member
28 return ctx->rate; in clk_dummy_recalc_rate()
34 /* Just return the same rate without modifying it */ in clk_dummy_determine_rate()
46 req->rate = req->max_rate; in clk_dummy_maximize_rate()
59 req->rate = req->min_rate; in clk_dummy_minimize_rate()
65 unsigned long rate, in clk_dummy_set_rate() argument
71 ctx->rate = rate; in clk_dummy_set_rate()
153 ctx->rate = DUMMY_CLOCK_INIT_RATE; in clk_test_init_with_ops()
190 * Test that the actual rate matches what is returned by clk_get_rate()
197 unsigned long rate; in clk_test_get_rate() local
199 rate = clk_get_rate(clk); 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()
207 * Test that, after a call to clk_set_rate(), the rate returned by
211 * modify the requested rate, which is our case in clk_dummy_rate_ops.
218 unsigned long rate; in clk_test_set_get_rate() local
224 rate = clk_get_rate(clk); 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()
232 * Test that, after several calls to clk_set_rate(), the rate returned
236 * modify the requested rate, which is our case in clk_dummy_rate_ops.
243 unsigned long rate; in clk_test_set_set_get_rate() local
253 rate = clk_get_rate(clk); 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()
295 * Test suite for a basic rate clock, without any parent.
297 * These tests exercise the rate API with simple scenarios
316 ctx->rate = DUMMY_CLOCK_INIT_RATE; in clk_uncached_test_init()
330 * the rate and clk_get_rate() will return the underlying clock rate
338 unsigned long rate; in clk_test_uncached_get_rate() local
340 rate = clk_get_rate(clk); 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()
344 /* We change the rate behind the clock framework's back */ in clk_test_uncached_get_rate()
345 ctx->rate = DUMMY_CLOCK_RATE_1; in clk_test_uncached_get_rate()
346 rate = clk_get_rate(clk); 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()
355 * properly if the rate hasn't changed.
362 unsigned long rate; in clk_test_uncached_set_range() local
370 rate = clk_get_rate(clk); 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()
380 * properly if the rate has changed in hardware.
382 * In this case, it means that if the rate wasn't initially in the range
384 * without the kernel knowing about it, its rate shouldn't be affected.
391 unsigned long rate; in clk_test_uncached_updated_rate_set_range() local
393 /* We change the rate behind the clock framework's back */ in clk_test_uncached_updated_rate_set_range()
394 ctx->rate = DUMMY_CLOCK_RATE_1 + 1000; in clk_test_uncached_updated_rate_set_range()
401 rate = clk_get_rate(clk); 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()
416 * Test suite for a basic, uncached, rate clock, without any parent.
418 * These tests exercise the rate API with simple scenarios
442 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_multiple_parents_mux_test_init()
450 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_multiple_parents_mux_test_init()
519 * that clock and the parent is changed, its rate after the reparenting
523 * reevaluate whether the new clock rate is within its boundaries or
533 unsigned long rate; in clk_test_multiple_parents_mux_set_range_set_parent_get_rate() local
559 rate = clk_get_rate(clk); 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()
606 ctx->parents_ctx[1].rate = DUMMY_CLOCK_INIT_RATE; in clk_orphan_transparent_multiple_parent_mux_test_init()
677 * rate.
711 * parent, the rate of the mux and its new parent are consistent.
720 unsigned long parent_rate, rate; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate() local
732 rate = clk_get_rate(clk); 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()
742 * parent, calling clk_put() on the mux won't affect the parent rate.
776 * its rate is out of range.
785 unsigned long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified() local
797 rate = clk_get_rate(clk); 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()
809 * its rate is within range.
846 * account when rounding a rate.
854 unsigned long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate() local
860 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); 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()
869 * Test that, for a mux that started orphan, was assigned and rate and
870 * then got switched to a valid parent, its rate is eventually within
873 * FIXME: Even though we update the rate as part of clk_set_parent(), we
874 * don't evaluate whether that new rate is within range and needs to be
884 unsigned long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate() local
897 rate = clk_get_rate(clk); 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()
950 ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; in clk_single_parent_mux_test_init()
1017 * Test that for a clock that can't modify its rate and with a single
1049 * Test that for a clock that can't modify its rate and with a single
1081 * Test that for a clock that can't modify its rate and with a single
1093 unsigned long rate; in clk_test_single_parent_mux_set_range_round_rate_parent_only() local
1102 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); 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()
1111 * Test that for a clock that can't modify its rate and with a single
1123 unsigned long rate; in clk_test_single_parent_mux_set_range_round_rate_child_smaller() local
1135 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); 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()
1140 rate = clk_round_rate(clk, 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()
1149 * Test that for a clock that can't modify its rate and with a single
1161 unsigned long rate; in clk_test_single_parent_mux_set_range_round_rate_parent_smaller() local
1173 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); 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()
1178 rate = clk_round_rate(clk, 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()
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.
2151 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_leaf_mux_set_rate_parent_test_init()
2159 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_leaf_mux_set_rate_parent_test_init()
2193 * Test that, for a clock that will forward any rate request to its
2194 * parent, the rate request structure returned by __clk_determine_rate
2203 unsigned long rate; in clk_leaf_mux_set_rate_parent_determine_rate() local
2206 rate = clk_get_rate(clk); 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()
2214 KUNIT_EXPECT_EQ(test, req.rate, DUMMY_CLOCK_RATE_2); in clk_leaf_mux_set_rate_parent_determine_rate()
2228 * The leaf clock has CLK_SET_RATE_PARENT, and will forward rate
2230 * fit for a given rate.
2236 .name = "clk-leaf-mux-set-rate-parent",
2301 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_mux_notifier_test_init()
2309 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_mux_notifier_test_init()