diff options
author | Igor Prusov <ivprusov@salutedevices.com> | 2023-12-06 02:23:34 +0300 |
---|---|---|
committer | Sean Anderson <seanga2@gmail.com> | 2023-12-15 12:32:00 -0500 |
commit | 9e0250321a0d7c7b17fcbac172dd3d3c000ee53a (patch) | |
tree | 74c894785ed54cf3f4d5f1708cdc045650ef8f2d /test | |
parent | 54d7da77306257a03231b04e7f2f9393ad7b0e46 (diff) | |
download | u-boot-9e0250321a0d7c7b17fcbac172dd3d3c000ee53a.tar.gz |
dm: test: clk: Add test for ccf clk_set_rate()
Add a simple test case which sets clock rate to its current value.
Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231205232334.2931-3-ivprusov@salutedevices.com
Diffstat (limited to 'test')
-rw-r--r-- | test/dm/clk_ccf.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index e4ebb93cdad..3b239825414 100644 --- a/test/dm/clk_ccf.c +++ b/test/dm/clk_ccf.c @@ -63,6 +63,9 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) rate = clk_get_parent_rate(clk); ut_asserteq(rate, 60000000); + rate = clk_set_rate(clk, 60000000); + ut_asserteq(rate, -ENOSYS); + rate = clk_get_rate(clk); ut_asserteq(rate, 60000000); @@ -87,6 +90,9 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) ut_asserteq_str("pll3_80m", pclk->dev->name); ut_asserteq(CLK_SET_RATE_PARENT, pclk->flags); + rate = clk_set_rate(clk, 80000000); + ut_asserteq(rate, -ENOSYS); + rate = clk_get_rate(clk); ut_asserteq(rate, 80000000); @@ -108,6 +114,9 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) rate = clk_get_rate(clk); ut_asserteq(rate, 60000000); + rate = clk_set_rate(clk, 60000000); + ut_asserteq(rate, 60000000); + #if CONFIG_IS_ENABLED(CLK_CCF) /* Test clk tree enable/disable */ ret = clk_get_by_id(SANDBOX_CLK_I2C_ROOT, &clk); |