From e6849e2fd88f16d9592059422173f7f6ab790e07 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 21 Aug 2019 13:35:03 +0000 Subject: clk: introduce enable_count As what Linux Kernel 5.3.0 provides when enable/disable clk, there is an enable_count in clk_core_disable/enable. Introduce enable_count to track the clk enable/disable count when clk_enable/disable for CCF. And Initialize enable_count to 0 when register the clk. And clk tree dump with enable_count will be supported, it will be easy for us to check the clk status with enable_count Signed-off-by: Peng Fan --- include/clk.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/clk.h b/include/clk.h index 3ca2796b57..18b2e3ca54 100644 --- a/include/clk.h +++ b/include/clk.h @@ -61,6 +61,7 @@ struct clk { struct udevice *dev; long long rate; /* in HZ */ u32 flags; + int enable_count; /* * Written by of_xlate. In the future, we might add more fields here. */ -- cgit From c66f4f5e3018e7df5249ae7e100ad85d9d2cb33f Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 21 Aug 2019 13:35:19 +0000 Subject: sandbox: clk: add clk enable/disable test code Since we added clk enable_count and prograte clk child enabling operation to clk parent, so add a new function sandbox_clk_enable_count to get enable_count for test usage. And add test code to get the enable_count after we enable/disable the device clk. Signed-off-by: Peng Fan --- include/sandbox-clk.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sandbox-clk.h b/include/sandbox-clk.h index f449de1364..296cddfbb0 100644 --- a/include/sandbox-clk.h +++ b/include/sandbox-clk.h @@ -20,6 +20,7 @@ enum { SANDBOX_CLK_USDHC1_SEL, SANDBOX_CLK_USDHC2_SEL, SANDBOX_CLK_I2C, + SANDBOX_CLK_I2C_ROOT, }; enum sandbox_pllv3_type { @@ -74,4 +75,6 @@ static inline struct clk *sandbox_clk_mux(const char *name, void __iomem *reg, width, 0); } +int sandbox_clk_enable_count(struct clk *clk); + #endif /* __SANDBOX_CLK_H__ */ -- cgit