Commit 5776526b authored by Stephen Boyd's avatar Stephen Boyd

clk: Add KUnit tests for clk fixed rate basic type

Test that the fixed rate basic type clk works as intended.

Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20240718210513.3801024-8-sboyd@kernel.org
parent d690bd11
CONFIG_KUNIT=y CONFIG_KUNIT=y
CONFIG_OF=y
CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK=y
CONFIG_CLK_KUNIT_TEST=y CONFIG_CLK_KUNIT_TEST=y
CONFIG_CLK_FIXED_RATE_KUNIT_TEST=y
CONFIG_CLK_GATE_KUNIT_TEST=y CONFIG_CLK_GATE_KUNIT_TEST=y
CONFIG_CLK_FD_KUNIT_TEST=y CONFIG_CLK_FD_KUNIT_TEST=y
CONFIG_UML_PCI_OVER_VIRTIO=n CONFIG_UML_PCI_OVER_VIRTIO=n
...@@ -512,6 +512,15 @@ config CLK_KUNIT_TEST ...@@ -512,6 +512,15 @@ config CLK_KUNIT_TEST
help help
Kunit tests for the common clock framework. Kunit tests for the common clock framework.
config CLK_FIXED_RATE_KUNIT_TEST
tristate "Basic fixed rate clk type KUnit test" if !KUNIT_ALL_TESTS
depends on KUNIT
default KUNIT_ALL_TESTS
select OF_OVERLAY if OF
select DTC
help
KUnit tests for the basic fixed rate clk type.
config CLK_GATE_KUNIT_TEST config CLK_GATE_KUNIT_TEST
tristate "Basic gate type Kunit test" if !KUNIT_ALL_TESTS tristate "Basic gate type Kunit test" if !KUNIT_ALL_TESTS
depends on KUNIT depends on KUNIT
......
...@@ -6,6 +6,8 @@ obj-$(CONFIG_CLK_KUNIT_TEST) += clk_test.o ...@@ -6,6 +6,8 @@ obj-$(CONFIG_CLK_KUNIT_TEST) += clk_test.o
obj-$(CONFIG_COMMON_CLK) += clk-divider.o obj-$(CONFIG_COMMON_CLK) += clk-divider.o
obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o
obj-$(CONFIG_CLK_FIXED_RATE_KUNIT_TEST) += clk-fixed-rate-test.o
clk-fixed-rate-test-y := clk-fixed-rate_test.o kunit_clk_fixed_rate_test.dtbo.o
obj-$(CONFIG_COMMON_CLK) += clk-gate.o obj-$(CONFIG_COMMON_CLK) += clk-gate.o
obj-$(CONFIG_CLK_GATE_KUNIT_TEST) += clk-gate_test.o obj-$(CONFIG_CLK_GATE_KUNIT_TEST) += clk-gate_test.o
obj-$(CONFIG_COMMON_CLK) += clk-multiplier.o obj-$(CONFIG_COMMON_CLK) += clk-multiplier.o
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _CLK_FIXED_RATE_TEST_H
#define _CLK_FIXED_RATE_TEST_H
#define TEST_FIXED_FREQUENCY 50000000
#define TEST_FIXED_ACCURACY 300
#endif
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
#include "clk-fixed-rate_test.h"
&{/} {
fixed_50MHz: kunit-clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <TEST_FIXED_FREQUENCY>;
clock-accuracy = <TEST_FIXED_ACCURACY>;
};
kunit-clock-consumer {
compatible = "test,single-clk-consumer";
clocks = <&fixed_50MHz>;
};
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment