Skip to content

Commit 274aff8

Browse files
committed
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 <[email protected]> Cc: Brendan Higgins <[email protected]> Reviewed-by: David Gow <[email protected]> Cc: Rae Moar <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5776526 commit 274aff8

File tree

5 files changed

+495
-2
lines changed

5 files changed

+495
-2
lines changed

drivers/clk/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ config CLK_KUNIT_TEST
509509
tristate "Basic Clock Framework Kunit Tests" if !KUNIT_ALL_TESTS
510510
depends on KUNIT
511511
default KUNIT_ALL_TESTS
512+
select OF_OVERLAY if OF
513+
select DTC
512514
help
513515
Kunit tests for the common clock framework.
514516

drivers/clk/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# common clock types
33
obj-$(CONFIG_HAVE_CLK) += clk-devres.o clk-bulk.o clkdev.o
44
obj-$(CONFIG_COMMON_CLK) += clk.o
5-
obj-$(CONFIG_CLK_KUNIT_TEST) += clk_test.o
5+
obj-$(CONFIG_CLK_KUNIT_TEST) += clk-test.o
6+
clk-test-y := clk_test.o \
7+
kunit_clk_parent_data_test.dtbo.o
68
obj-$(CONFIG_COMMON_CLK) += clk-divider.o
79
obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
810
obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o

drivers/clk/clk_parent_data_test.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _CLK_PARENT_DATA_TEST_H
3+
#define _CLK_PARENT_DATA_TEST_H
4+
5+
#define CLK_PARENT_DATA_1MHZ_NAME "1mhz_fixed_legacy"
6+
#define CLK_PARENT_DATA_PARENT1 "parent_fwname"
7+
#define CLK_PARENT_DATA_PARENT2 "50"
8+
#define CLK_PARENT_DATA_50MHZ_NAME "50_clk"
9+
10+
#endif

0 commit comments

Comments
 (0)