Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336514
b: refs/heads/master
c: 7c045a5
h: refs/heads/master
v: v3
  • Loading branch information
Mike Turquette committed Dec 11, 2012
1 parent b9a4d20 commit d6e613b
Show file tree
Hide file tree
Showing 3 changed files with 18 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: 2630b17b6ee47ac79b4f5120ac49105027f644ea
refs/heads/master: 7c045a55c97fb83a2e5e9c6c857162c4866cc602
13 changes: 11 additions & 2 deletions trunk/drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,17 @@ static void clk_disable_unused_subtree(struct clk *clk)
if (clk->flags & CLK_IGNORE_UNUSED)
goto unlock_out;

if (__clk_is_enabled(clk) && clk->ops->disable)
clk->ops->disable(clk->hw);
/*
* some gate clocks have special needs during the disable-unused
* sequence. call .disable_unused if available, otherwise fall
* back to .disable
*/
if (__clk_is_enabled(clk)) {
if (clk->ops->disable_unused)
clk->ops->disable_unused(clk->hw);
else if (clk->ops->disable)
clk->ops->disable(clk->hw);
}

unlock_out:
spin_unlock_irqrestore(&enable_lock, flags);
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/clk-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ struct clk_hw;
* This function must not sleep. Optional, if this op is not
* set then the enable count will be used.
*
* @disable_unused: Disable the clock atomically. Only called from
* clk_disable_unused for gate clocks with special needs.
* Called with enable_lock held. This function must not
* sleep.
*
* @recalc_rate Recalculate the rate of this clock, by querying hardware. The
* parent rate is an input parameter. It is up to the caller to
* ensure that the prepare_mutex is held across this call.
Expand Down Expand Up @@ -106,6 +111,7 @@ struct clk_ops {
int (*enable)(struct clk_hw *hw);
void (*disable)(struct clk_hw *hw);
int (*is_enabled)(struct clk_hw *hw);
void (*disable_unused)(struct clk_hw *hw);
unsigned long (*recalc_rate)(struct clk_hw *hw,
unsigned long parent_rate);
long (*round_rate)(struct clk_hw *hw, unsigned long,
Expand Down

0 comments on commit d6e613b

Please sign in to comment.