From 9d04b6baab847a40fe4980562ac5ab05bd7d0989 Mon Sep 17 00:00:00 2001 From: GUI <39894654+GuEe-GUI@users.noreply.github.com> Date: Sat, 8 Aug 2026 18:25:02 +0800 Subject: [dm][clk] fixup the work flow of CLK (#11673) * [dm][clk] fixup the work flow of CLK Add RT_CLK_F_SET_RATE_NO_REPARENT so clock providers can preserv the currently selected parent during rate changes. Round and re-read the effective clock rate after parent handling, skip redundant gate toggles and hardware programming when the target is already active, and fix error handling for parent-clock allocation failures. Signed-off-by: GuEe-GUI <2991707448@qq.com> * style: format code with clang-format * style: format complete changed files with clang-format --------- Signed-off-by: GuEe-GUI <2991707448@qq.com> --- components/drivers/include/drivers/clk.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'components/drivers/include') diff --git a/components/drivers/include/drivers/clk.h b/components/drivers/include/drivers/clk.h index dd74fdc85b..5a282bdcb1 100644 --- a/components/drivers/include/drivers/clk.h +++ b/components/drivers/include/drivers/clk.h @@ -84,6 +84,7 @@ struct rt_clk_node #define RT_CLK_F_SET_RATE_UNGATE RT_BIT(4) /**< Clock needs to run to set rate */ #define RT_CLK_F_IS_CRITICAL RT_BIT(5) /**< Do not gate, ever */ #define RT_CLK_F_GET_RATE_NOCACHE RT_BIT(6) /**< Do not get rate by cache */ +#define RT_CLK_F_SET_RATE_NO_REPARENT RT_BIT(7) /**< Keep the selected parent across rate changes */ /** * @brief Clock cell - represents a single hardware clock element. @@ -299,4 +300,4 @@ rt_inline rt_err_t rt_ofw_clk_set_defaults(struct rt_ofw_node *np) /*! @}*/ -#endif /* __CLK_H__ */ \ No newline at end of file +#endif /* __CLK_H__ */ -- cgit v1.3.1