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>
This commit is contained in:

committed by
Mike Turquette

parent
1c155b3dfe
commit
3cc8247f1d
@@ -352,9 +352,12 @@ static void clk_unprepare_unused_subtree(struct clk *clk)
|
||||
if (clk->flags & CLK_IGNORE_UNUSED)
|
||||
return;
|
||||
|
||||
if (__clk_is_prepared(clk))
|
||||
if (clk->ops->unprepare)
|
||||
if (__clk_is_prepared(clk)) {
|
||||
if (clk->ops->unprepare_unused)
|
||||
clk->ops->unprepare_unused(clk->hw);
|
||||
else if (clk->ops->unprepare)
|
||||
clk->ops->unprepare(clk->hw);
|
||||
}
|
||||
}
|
||||
|
||||
/* caller must hold prepare_lock */
|
||||
|
Reference in New Issue
Block a user