]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
clk: Expose clk_hw_reparent() to providers
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Wed, 11 Mar 2015 10:34:25 +0000 (11:34 +0100)
committerThierry Reding <treding@nvidia.com>
Mon, 30 Mar 2015 09:47:30 +0000 (11:47 +0200)
To be used by clock implementations for switching to a new parent during
rate change.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/clk/clk.c
include/linux/clk-provider.h

index eb0152961d3c60652af108246e9d10be9d13a371..f7930257b33b83a9bf621b68d3ea9d16f1baa81e 100644 (file)
@@ -1968,6 +1968,14 @@ static void clk_core_reparent(struct clk_core *clk,
        __clk_recalc_rates(clk, POST_RATE_CHANGE);
 }
 
+void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent)
+{
+       if (!hw)
+               return;
+
+       clk_core_reparent(hw->core, !new_parent ? NULL : new_parent->core);
+}
+
 /**
  * clk_has_parent - check if a clock is a possible parent for another
  * @clk: clock source
index 5591ea71a8d14054bf923dcad45dc94f71bd029a..28abf1badb4017deb205f078bd1d416fa578eac3 100644 (file)
@@ -589,6 +589,7 @@ long __clk_mux_determine_rate_closest(struct clk_hw *hw, unsigned long rate,
                              unsigned long max_rate,
                              unsigned long *best_parent_rate,
                              struct clk_hw **best_parent_p);
+void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent);
 
 static inline void __clk_hw_set_clk(struct clk_hw *dst, struct clk_hw *src)
 {