aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2014-09-05 15:47:25 -0700
committerAndrey Konovalov <andrey.konovalov@linaro.org>2015-01-13 17:56:44 +0300
commit200bb9ea0dea68ff59fbb15e797c1d036419fb86 (patch)
tree66a146b442d8970abeb090c92460ae88210dc60e /include
parent7ab71a60ee0ccba3a42538f2c67ad786a4d43831 (diff)
clk: Add safe switch hook
Sometimes clocks can't accept their parent source turning off while the source is reprogrammed to a different rate. Most notably some CPU clocks require a way to switch away from the current PLL they're running on, reprogram that PLL to a new rate, and then switch back to the PLL with the new rate once they're done. Add a hook that drivers can implement allowing them to return a 'safe parent' that they can switch their parent to while the upstream source is reprogrammed. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/clk-private.h2
-rw-r--r--include/linux/clk-provider.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index 0ca5f6046920..681c6e0aa42c 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -38,8 +38,10 @@ struct clk {
struct clk **parents;
u8 num_parents;
u8 new_parent_index;
+ u8 safe_parent_index;
unsigned long rate;
unsigned long new_rate;
+ struct clk *safe_parent;
struct clk *new_parent;
struct clk *new_child;
unsigned long flags;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 01d02c7fb6bf..0f792e720546 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -179,6 +179,7 @@ struct clk_ops {
struct clk_hw **best_parent_hw);
int (*set_parent)(struct clk_hw *hw, u8 index);
u8 (*get_parent)(struct clk_hw *hw);
+ struct clk *(*get_safe_parent)(struct clk_hw *hw);
int (*set_rate)(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate);
int (*set_rate_and_parent)(struct clk_hw *hw,