Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365275
b: refs/heads/master
c: 3cc8247
h: refs/heads/master
i:
  365273: 2670006
  365271: 167e158
v: v3
  • Loading branch information
Ulf Hansson authored and Mike Turquette committed Mar 19, 2013
1 parent e2236ca commit 356ed1f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c155b3dfe08351f5fc811062648969f1ba7af53
refs/heads/master: 3cc8247f1dce79511de8bf0f69ab02a46cc315b7
7 changes: 5 additions & 2 deletions trunk/drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/clk-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 356ed1f

Please sign in to comment.