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()
110 * clk_round_rate() or clk_set_rate() with a rate lower than
114 * behaviour to always pick up the closest rate higher than the
115 * requested rate. If we get something lower, it thus considers
119 * between rates above the parent rate which would be rounded to
176 ctx->rate = DUMMY_CLOCK_INIT_RATE; in clk_test_init_with_ops()
213 * Test that the actual rate matches what is returned by clk_get_rate()
220 unsigned long rate; in clk_test_get_rate() local
222 rate = clk_get_rate(clk); in clk_test_get_rate()
223 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_get_rate()
224 KUNIT_EXPECT_EQ(test, rate, ctx->rate); in clk_test_get_rate()
230 * Test that, after a call to clk_set_rate(), the rate returned by
234 * modify the requested rate, which is our case in clk_dummy_rate_ops.
241 unsigned long rate; in clk_test_set_get_rate() local
247 rate = clk_get_rate(clk); in clk_test_set_get_rate()
248 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_set_get_rate()
249 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_set_get_rate()
255 * Test that, after several calls to clk_set_rate(), the rate returned
259 * modify the requested rate, which is our case in clk_dummy_rate_ops.
266 unsigned long rate; in clk_test_set_set_get_rate() local
276 rate = clk_get_rate(clk); in clk_test_set_set_get_rate()
277 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_set_set_get_rate()
278 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_set_set_get_rate()
319 * Test suite for a basic rate clock, without any parent.
321 * These tests exercise the rate API with simple scenarios
340 ctx->rate = DUMMY_CLOCK_INIT_RATE; in clk_uncached_test_init()
354 * the rate and clk_get_rate() will return the underlying clock rate
362 unsigned long rate; in clk_test_uncached_get_rate() local
364 rate = clk_get_rate(clk); in clk_test_uncached_get_rate()
365 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_get_rate()
366 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); in clk_test_uncached_get_rate()
368 /* We change the rate behind the clock framework's back */ in clk_test_uncached_get_rate()
369 ctx->rate = DUMMY_CLOCK_RATE_1; in clk_test_uncached_get_rate()
370 rate = clk_get_rate(clk); in clk_test_uncached_get_rate()
371 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_get_rate()
372 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_uncached_get_rate()
379 * properly if the rate hasn't changed.
386 unsigned long rate; in clk_test_uncached_set_range() local
394 rate = clk_get_rate(clk); in clk_test_uncached_set_range()
395 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_set_range()
396 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_uncached_set_range()
397 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_uncached_set_range()
404 * properly if the rate has changed in hardware.
406 * In this case, it means that if the rate wasn't initially in the range
408 * without the kernel knowing about it, its rate shouldn't be affected.
415 unsigned long rate; in clk_test_uncached_updated_rate_set_range() local
417 /* We change the rate behind the clock framework's back */ in clk_test_uncached_updated_rate_set_range()
418 ctx->rate = DUMMY_CLOCK_RATE_1 + 1000; in clk_test_uncached_updated_rate_set_range()
425 rate = clk_get_rate(clk); in clk_test_uncached_updated_rate_set_range()
426 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_uncached_updated_rate_set_range()
427 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_uncached_updated_rate_set_range()
440 * Test suite for a basic, uncached, rate clock, without any parent.
442 * These tests exercise the rate API with simple scenarios
466 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_multiple_parents_mux_test_init()
474 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_multiple_parents_mux_test_init()
543 * that clock and the parent is changed, its rate after the reparenting
547 * reevaluate whether the new clock rate is within its boundaries or
557 unsigned long rate; in clk_test_multiple_parents_mux_set_range_set_parent_get_rate() local
583 rate = clk_get_rate(clk); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
584 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
585 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
586 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_multiple_parents_mux_set_range_set_parent_get_rate()
630 ctx->parents_ctx[1].rate = DUMMY_CLOCK_INIT_RATE; in clk_orphan_transparent_multiple_parent_mux_test_init()
701 * rate.
735 * parent, the rate of the mux and its new parent are consistent.
744 unsigned long parent_rate, rate; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate() local
756 rate = clk_get_rate(clk); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
757 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
758 KUNIT_EXPECT_EQ(test, parent_rate, rate); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_get_rate()
766 * parent, calling clk_put() on the mux won't affect the parent rate.
800 * its rate is out of range.
809 unsigned long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified() local
821 rate = clk_get_rate(clk); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
822 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
823 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
824 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified()
833 * its rate is within range.
870 * account when rounding a rate.
878 long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate() local
884 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
885 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
886 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
887 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate()
893 * Test that, for a mux that started orphan, was assigned and rate and
894 * then got switched to a valid parent, its rate is eventually within
897 * FIXME: Even though we update the rate as part of clk_set_parent(), we
898 * don't evaluate whether that new rate is within range and needs to be
908 unsigned long rate; in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate() local
921 rate = clk_get_rate(clk); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
922 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
923 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
924 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate()
974 ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; in clk_single_parent_mux_test_init()
1041 * Test that for a clock that can't modify its rate and with a single
1073 * Test that for a clock that can't modify its rate and with a single
1105 * Test that for a clock that can't modify its rate and with a single
1117 long rate; in clk_test_single_parent_mux_set_range_round_rate_parent_only() local
1126 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1127 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1128 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1129 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_test_single_parent_mux_set_range_round_rate_parent_only()
1135 * Test that for a clock that can't modify its rate and with a single
1147 long rate; in clk_test_single_parent_mux_set_range_round_rate_child_smaller() local
1159 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1160 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1161 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1162 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1164 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_2 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1165 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1166 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1167 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_child_smaller()
1173 * Test that for a clock that can't modify its rate and with a single
1185 long rate; in clk_test_single_parent_mux_set_range_round_rate_parent_smaller() local
1197 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1198 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1199 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1200 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1202 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_2 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1203 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1204 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1205 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_test_single_parent_mux_set_range_round_rate_parent_smaller()
1263 ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; in clk_orphan_transparent_single_parent_mux_test_init()
1273 * Test that a mux-only clock, with an initial rate within a range,
1274 * will still have the same rate after the range has been enforced.
1284 unsigned long rate, new_rate; in clk_test_orphan_transparent_parent_mux_set_range() local
1286 rate = clk_get_rate(clk); in clk_test_orphan_transparent_parent_mux_set_range()
1287 KUNIT_ASSERT_GT(test, rate, 0); in clk_test_orphan_transparent_parent_mux_set_range()
1291 ctx->parent_ctx.rate - 1000, in clk_test_orphan_transparent_parent_mux_set_range()
1292 ctx->parent_ctx.rate + 1000), in clk_test_orphan_transparent_parent_mux_set_range()
1297 KUNIT_EXPECT_EQ(test, rate, new_rate); in clk_test_orphan_transparent_parent_mux_set_range()
1356 ctx->parent_parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; in clk_orphan_two_level_root_last_test_init()
1380 * will return the proper rate.
1388 unsigned long rate; in clk_orphan_two_level_root_last_test_get_rate() local
1390 rate = clk_get_rate(clk); in clk_orphan_two_level_root_last_test_get_rate()
1391 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); in clk_orphan_two_level_root_last_test_get_rate()
1398 * clk_set_rate_range() won't affect its rate if it is already within
1410 unsigned long rate; in clk_orphan_two_level_root_last_test_set_range() local
1418 rate = clk_get_rate(clk); in clk_orphan_two_level_root_last_test_set_range()
1419 KUNIT_ASSERT_GT(test, rate, 0); in clk_orphan_two_level_root_last_test_set_range()
1420 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); in clk_orphan_two_level_root_last_test_set_range()
1454 * and that it will make sure the rate of the clock is within the
1462 unsigned long rate; in clk_range_test_set_range() local
1470 rate = clk_get_rate(clk); in clk_range_test_set_range()
1471 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range()
1472 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range()
1473 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range()
1479 * Test that calling clk_set_rate_range with a minimum rate higher than
1480 * the maximum rate returns an error.
1526 * Test that if our clock has some boundaries and we try to round a rate
1527 * lower than the minimum, the returned rate will be within range.
1534 long rate; in clk_range_test_set_range_round_rate_lower() local
1542 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1 - 1000); in clk_range_test_set_range_round_rate_lower()
1543 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_round_rate_lower()
1544 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_round_rate_lower()
1545 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_round_rate_lower()
1551 * Test that if our clock has some boundaries and we try to set a rate
1552 * higher than the maximum, the new rate will be within range.
1559 unsigned long rate; in clk_range_test_set_range_set_rate_lower() local
1571 rate = clk_get_rate(clk); in clk_range_test_set_range_set_rate_lower()
1572 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_set_rate_lower()
1573 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_set_rate_lower()
1574 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_set_rate_lower()
1581 * set a rate lower than the minimum, the rate returned by
1582 * clk_round_rate() will be consistent with the new rate set by
1611 * Test that if our clock has some boundaries and we try to round a rate
1612 * higher than the maximum, the returned rate will be within range.
1619 long rate; in clk_range_test_set_range_round_rate_higher() local
1627 rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_2 + 1000); in clk_range_test_set_range_round_rate_higher()
1628 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_round_rate_higher()
1629 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_round_rate_higher()
1630 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_round_rate_higher()
1636 * Test that if our clock has some boundaries and we try to set a rate
1637 * higher than the maximum, the new rate will be within range.
1644 unsigned long rate; in clk_range_test_set_range_set_rate_higher() local
1656 rate = clk_get_rate(clk); in clk_range_test_set_range_set_rate_higher()
1657 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_set_rate_higher()
1658 KUNIT_EXPECT_GE(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_set_rate_higher()
1659 KUNIT_EXPECT_LE(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_set_rate_higher()
1666 * set a rate higher than the maximum, the rate returned by
1667 * clk_round_rate() will be consistent with the new rate set by
1696 * Test that if our clock has a rate lower than the minimum set by a
1697 * call to clk_set_rate_range(), the rate will be raised to match the
1701 * modify the requested rate, which is our case in clk_dummy_rate_ops.
1708 unsigned long rate; in clk_range_test_set_range_get_rate_raised() local
1720 rate = clk_get_rate(clk); in clk_range_test_set_range_get_rate_raised()
1721 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_get_rate_raised()
1722 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_get_rate_raised()
1728 * Test that if our clock has a rate higher than the maximum set by a
1729 * call to clk_set_rate_range(), the rate will be lowered to match the
1733 * modify the requested rate, which is our case in clk_dummy_rate_ops.
1740 unsigned long rate; in clk_range_test_set_range_get_rate_lowered() local
1752 rate = clk_get_rate(clk); in clk_range_test_set_range_get_rate_lowered()
1753 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_get_rate_lowered()
1754 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_get_rate_lowered()
1775 * Test suite for a basic rate clock, without any parent.
1777 * These tests exercise the rate range API: clk_set_rate_range(),
1789 * clk_set_rate_range(), the core will reevaluate whether a new rate is
1792 * With clk_dummy_maximize_rate_ops, this means that the rate will
1800 unsigned long rate; in clk_range_test_set_range_rate_maximized() local
1812 rate = clk_get_rate(clk); in clk_range_test_set_range_rate_maximized()
1813 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_maximized()
1814 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_rate_maximized()
1822 rate = clk_get_rate(clk); in clk_range_test_set_range_rate_maximized()
1823 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_maximized()
1824 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2 - 1000); in clk_range_test_set_range_rate_maximized()
1832 rate = clk_get_rate(clk); in clk_range_test_set_range_rate_maximized()
1833 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_maximized()
1834 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_set_range_rate_maximized()
1842 * whether a new rate is needed each and every time.
1844 * With clk_dummy_maximize_rate_ops, this means that the rate will
1853 unsigned long rate; in clk_range_test_multiple_set_range_rate_maximized() local
1871 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_maximized()
1872 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_maximized()
1873 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_maximized()
1881 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_maximized()
1882 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_maximized()
1883 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_maximized()
1889 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_maximized()
1890 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_maximized()
1891 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_maximized()
1901 * whether a new rate is needed, including when a user drop its clock.
1903 * With clk_dummy_maximize_rate_ops, this means that the rate will
1912 unsigned long rate; in clk_range_test_multiple_set_range_rate_put_maximized() local
1930 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_put_maximized()
1931 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_maximized()
1932 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_put_maximized()
1940 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_put_maximized()
1941 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_maximized()
1942 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_put_maximized()
1946 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_put_maximized()
1947 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_maximized()
1948 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_put_maximized()
1962 * Test suite for a basic rate clock, without any parent.
1964 * These tests exercise the rate range API: clk_set_rate_range(),
1966 * driver that will always try to run at the highest possible rate.
1977 * clk_set_rate_range(), the core will reevaluate whether a new rate is
1980 * With clk_dummy_minimize_rate_ops, this means that the rate will
1988 unsigned long rate; in clk_range_test_set_range_rate_minimized() local
2000 rate = clk_get_rate(clk); in clk_range_test_set_range_rate_minimized()
2001 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_minimized()
2002 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_rate_minimized()
2010 rate = clk_get_rate(clk); in clk_range_test_set_range_rate_minimized()
2011 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_minimized()
2012 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1 + 1000); in clk_range_test_set_range_rate_minimized()
2020 rate = clk_get_rate(clk); in clk_range_test_set_range_rate_minimized()
2021 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_set_range_rate_minimized()
2022 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_set_range_rate_minimized()
2030 * whether a new rate is needed each and every time.
2032 * With clk_dummy_minimize_rate_ops, this means that the rate will
2041 unsigned long rate; in clk_range_test_multiple_set_range_rate_minimized() local
2055 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_minimized()
2056 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_minimized()
2057 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_minimized()
2065 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_minimized()
2066 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_minimized()
2067 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_minimized()
2073 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_minimized()
2074 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_minimized()
2075 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_minimized()
2085 * whether a new rate is needed, including when a user drop its clock.
2087 * With clk_dummy_minimize_rate_ops, this means that the rate will
2096 unsigned long rate; in clk_range_test_multiple_set_range_rate_put_minimized() local
2110 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_put_minimized()
2111 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_minimized()
2112 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_put_minimized()
2120 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_put_minimized()
2121 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_minimized()
2122 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_2); in clk_range_test_multiple_set_range_rate_put_minimized()
2126 rate = clk_get_rate(clk); in clk_range_test_multiple_set_range_rate_put_minimized()
2127 KUNIT_ASSERT_GT(test, rate, 0); in clk_range_test_multiple_set_range_rate_put_minimized()
2128 KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_range_test_multiple_set_range_rate_put_minimized()
2142 * Test suite for a basic rate clock, without any parent.
2144 * These tests exercise the rate range API: clk_set_rate_range(),
2146 * driver that will always try to run at the lowest possible rate.
2175 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_leaf_mux_set_rate_parent_test_init()
2183 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_leaf_mux_set_rate_parent_test_init()
2217 * Test that, for a clock that will forward any rate request to its
2218 * parent, the rate request structure returned by __clk_determine_rate
2227 unsigned long rate; in clk_leaf_mux_set_rate_parent_determine_rate() local
2230 rate = clk_get_rate(clk); in clk_leaf_mux_set_rate_parent_determine_rate()
2231 KUNIT_ASSERT_EQ(test, rate, DUMMY_CLOCK_RATE_1); in clk_leaf_mux_set_rate_parent_determine_rate()
2238 KUNIT_EXPECT_EQ(test, req.rate, DUMMY_CLOCK_RATE_2); in clk_leaf_mux_set_rate_parent_determine_rate()
2252 * The leaf clock has CLK_SET_RATE_PARENT, and will forward rate
2254 * fit for a given rate.
2260 .name = "clk-leaf-mux-set-rate-parent",
2325 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_mux_notifier_test_init()
2333 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_mux_notifier_test_init()
2436 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1; in clk_mux_no_reparent_test_init()
2444 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2; in clk_mux_no_reparent_test_init()
2472 * clk_round_rate() on it with a rate that should cause it to change
2508 * clk_set_rate() on it with a rate that should cause it to change
2519 unsigned long rate; in clk_mux_no_reparent_set_rate() local
2539 rate = clk_get_rate(clk); in clk_mux_no_reparent_set_rate()
2540 KUNIT_ASSERT_GT(test, rate, 0); in clk_mux_no_reparent_set_rate()
2541 KUNIT_EXPECT_EQ(test, rate, parent_rate); in clk_mux_no_reparent_set_rate()