aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-03-12 15:26:04 -0400
committerMike Turquette <mturquette@linaro.org>2013-03-19 15:58:43 -0400
commit3cc8247f1dce79511de8bf0f69ab02a46cc315b7 (patch)
tree98b33064f74afe802360f3012dc12bf2e49c1781 /drivers/clk/clk.c
parent1c155b3dfe08351f5fc811062648969f1ba7af53 (diff)
clk: Introduce optional unprepare_unused callback
An unprepare_unused callback is introduced due to the same reasons to why the disable_unused callback was added. During the clk_disable_unused sequence, those clk_hw that needs specific treatment with regards to being unprepared, shall implement the unprepare_unused callback. Signed-off-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 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index c0141f3e1109..253792a46c08 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -352,9 +352,12 @@ static void clk_unprepare_unused_subtree(struct clk *clk)
352 if (clk->flags & CLK_IGNORE_UNUSED) 352 if (clk->flags & CLK_IGNORE_UNUSED)
353 return; 353 return;
354 354
355 if (__clk_is_prepared(clk)) 355 if (__clk_is_prepared(clk)) {
356 if (clk->ops->unprepare) 356 if (clk->ops->unprepare_unused)
357 clk->ops->unprepare_unused(clk->hw);
358 else if (clk->ops->unprepare)
357 clk->ops->unprepare(clk->hw); 359 clk->ops->unprepare(clk->hw);
360 }
358} 361}
359 362
360/* caller must hold prepare_lock */ 363/* caller must hold prepare_lock */