From 356ed1f750b0e00fca38ae8ca3ae56d40190a75a Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Tue, 12 Mar 2013 20:26:04 +0100 Subject: [PATCH] --- yaml --- r: 365275 b: refs/heads/master c: 3cc8247f1dce79511de8bf0f69ab02a46cc315b7 h: refs/heads/master i: 365273: 2670006bb1a6265b3d60fea495c3f59def411d11 365271: 167e15844617675dba9b225839a613afd79169dc v: v3 --- [refs] | 2 +- trunk/drivers/clk/clk.c | 7 +++++-- trunk/include/linux/clk-provider.h | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 857259beb18f..5a3ede6b701d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1c155b3dfe08351f5fc811062648969f1ba7af53 +refs/heads/master: 3cc8247f1dce79511de8bf0f69ab02a46cc315b7 diff --git a/trunk/drivers/clk/clk.c b/trunk/drivers/clk/clk.c index c0141f3e1109..253792a46c08 100644 --- a/trunk/drivers/clk/clk.c +++ b/trunk/drivers/clk/clk.c @@ -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 */ diff --git a/trunk/include/linux/clk-provider.h b/trunk/include/linux/clk-provider.h index ee946862e058..56e6cc12c796 100644 --- a/trunk/include/linux/clk-provider.h +++ b/trunk/include/linux/clk-provider.h @@ -49,6 +49,10 @@ struct clk_hw; * This function is allowed to sleep. Optional, if this op is not * set then the prepare count will be used. * + * @unprepare_unused: Unprepare the clock atomically. Only called from + * clk_disable_unused for prepare clocks with special needs. + * Called with prepare mutex held. This function may sleep. + * * @enable: Enable the clock atomically. This must not return until the * clock is generating a valid clock signal, usable by consumer * devices. Called with enable_lock held. This function must not @@ -113,6 +117,7 @@ struct clk_ops { int (*prepare)(struct clk_hw *hw); void (*unprepare)(struct clk_hw *hw); int (*is_prepared)(struct clk_hw *hw); + void (*unprepare_unused)(struct clk_hw *hw); int (*enable)(struct clk_hw *hw); void (*disable)(struct clk_hw *hw); int (*is_enabled)(struct clk_hw *hw);