aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clk-provider.h
diff options
context:
space:
mode:
authorMike Turquette <mturquette@linaro.org>2012-12-04 14:00:35 -0500
committerMike Turquette <mturquette@linaro.org>2012-12-11 01:35:02 -0500
commit7c045a55c97fb83a2e5e9c6c857162c4866cc602 (patch)
treee8c5a171b9b9085e86541aaccf9b85e3ec52298e /include/linux/clk-provider.h
parent2630b17b6ee47ac79b4f5120ac49105027f644ea (diff)
clk: introduce optional disable_unused callback
Some gate clocks have special needs which must be handled during the disable-unused clocks sequence. These needs might be driven by software due to the fact that we're disabling a clock outside of the normal clk_disable path and a clk's enable_count will not be accurate. On the other hand a specific hardware programming sequence might need to be followed for this corner case. This change is needed for the upcoming OMAP port to the common clock framework. Specifically, it is undesirable to treat the disable-unused path identically to the normal clk_disable path since other software layers are involved. In this case OMAP's clockdomain code throws WARNs and bails early due to the clock's enable_count being set to zero. A custom callback mitigates this problem nicely. Cc: Paul Walmsley <paul@pwsan.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk-provider.h')
-rw-r--r--include/linux/clk-provider.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 3593a3ce3f0d..1c94d18514e2 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -57,6 +57,11 @@ struct clk_hw;
57 * This function must not sleep. Optional, if this op is not 57 * This function must not sleep. Optional, if this op is not
58 * set then the enable count will be used. 58 * set then the enable count will be used.
59 * 59 *
60 * @disable_unused: Disable the clock atomically. Only called from
61 * clk_disable_unused for gate clocks with special needs.
62 * Called with enable_lock held. This function must not
63 * sleep.
64 *
60 * @recalc_rate Recalculate the rate of this clock, by querying hardware. The 65 * @recalc_rate Recalculate the rate of this clock, by querying hardware. The
61 * parent rate is an input parameter. It is up to the caller to 66 * parent rate is an input parameter. It is up to the caller to
62 * ensure that the prepare_mutex is held across this call. 67 * ensure that the prepare_mutex is held across this call.
@@ -106,6 +111,7 @@ struct clk_ops {
106 int (*enable)(struct clk_hw *hw); 111 int (*enable)(struct clk_hw *hw);
107 void (*disable)(struct clk_hw *hw); 112 void (*disable)(struct clk_hw *hw);
108 int (*is_enabled)(struct clk_hw *hw); 113 int (*is_enabled)(struct clk_hw *hw);
114 void (*disable_unused)(struct clk_hw *hw);
109 unsigned long (*recalc_rate)(struct clk_hw *hw, 115 unsigned long (*recalc_rate)(struct clk_hw *hw,
110 unsigned long parent_rate); 116 unsigned long parent_rate);
111 long (*round_rate)(struct clk_hw *hw, unsigned long, 117 long (*round_rate)(struct clk_hw *hw, unsigned long,