Commit 274aff87 authored by Stephen Boyd's avatar Stephen Boyd

clk: Add KUnit tests for clks registered with struct clk_parent_data

Test that clks registered with 'struct clk_parent_data' work as
intended and can find their parents.

Cc: Christian Marangi <ansuelsmth@gmail.com>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Reviewed-by: default avatarDavid 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-9-sboyd@kernel.org
parent 5776526b
...@@ -509,6 +509,8 @@ config CLK_KUNIT_TEST ...@@ -509,6 +509,8 @@ config CLK_KUNIT_TEST
tristate "Basic Clock Framework Kunit Tests" if !KUNIT_ALL_TESTS tristate "Basic Clock Framework Kunit Tests" if !KUNIT_ALL_TESTS
depends on KUNIT depends on KUNIT
default KUNIT_ALL_TESTS default KUNIT_ALL_TESTS
select OF_OVERLAY if OF
select DTC
help help
Kunit tests for the common clock framework. Kunit tests for the common clock framework.
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
# common clock types # common clock types
obj-$(CONFIG_HAVE_CLK) += clk-devres.o clk-bulk.o clkdev.o obj-$(CONFIG_HAVE_CLK) += clk-devres.o clk-bulk.o clkdev.o
obj-$(CONFIG_COMMON_CLK) += clk.o obj-$(CONFIG_COMMON_CLK) += clk.o
obj-$(CONFIG_CLK_KUNIT_TEST) += clk_test.o obj-$(CONFIG_CLK_KUNIT_TEST) += clk-test.o
clk-test-y := clk_test.o \
kunit_clk_parent_data_test.dtbo.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
......
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _CLK_PARENT_DATA_TEST_H
#define _CLK_PARENT_DATA_TEST_H
#define CLK_PARENT_DATA_1MHZ_NAME "1mhz_fixed_legacy"
#define CLK_PARENT_DATA_PARENT1 "parent_fwname"
#define CLK_PARENT_DATA_PARENT2 "50"
#define CLK_PARENT_DATA_50MHZ_NAME "50_clk"
#endif
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
#include "clk_parent_data_test.h"
&{/} {
fixed_50: kunit-clock-50MHz {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <50000000>;
clock-output-names = CLK_PARENT_DATA_50MHZ_NAME;
};
fixed_parent: kunit-clock-1MHz {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <1000000>;
clock-output-names = CLK_PARENT_DATA_1MHZ_NAME;
};
kunit-clock-controller {
compatible = "test,clk-parent-data";
clocks = <&fixed_parent>, <&fixed_50>;
clock-names = CLK_PARENT_DATA_PARENT1, CLK_PARENT_DATA_PARENT2;
#clock-cells = <1>;
};
};
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