summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/clk/clk.c8
-rw-r--r--include/linux/clk-provider.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 459ce9da13e0..5315a273eae9 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2020,6 +2020,14 @@ static void clk_core_reparent(struct clk_core *clk,
2020 __clk_recalc_rates(clk, POST_RATE_CHANGE); 2020 __clk_recalc_rates(clk, POST_RATE_CHANGE);
2021} 2021}
2022 2022
2023void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent)
2024{
2025 if (!hw)
2026 return;
2027
2028 clk_core_reparent(hw->core, !new_parent ? NULL : new_parent->core);
2029}
2030
2023/** 2031/**
2024 * clk_has_parent - check if a clock is a possible parent for another 2032 * clk_has_parent - check if a clock is a possible parent for another
2025 * @clk: clock source 2033 * @clk: clock source
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index df695313f975..51efb9ec3e37 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -589,6 +589,7 @@ long __clk_mux_determine_rate_closest(struct clk_hw *hw, unsigned long rate,
589 unsigned long max_rate, 589 unsigned long max_rate,
590 unsigned long *best_parent_rate, 590 unsigned long *best_parent_rate,
591 struct clk_hw **best_parent_p); 591 struct clk_hw **best_parent_p);
592void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent);
592 593
593static inline void __clk_hw_set_clk(struct clk_hw *dst, struct clk_hw *src) 594static inline void __clk_hw_set_clk(struct clk_hw *dst, struct clk_hw *src)
594{ 595{