Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324296
b: refs/heads/master
c: a093bde
h: refs/heads/master
v: v3
  • Loading branch information
Ulf Hansson authored and Mike Turquette committed Sep 7, 2012
1 parent 12bd646 commit d91e7cd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 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: 73118e6188c23719eeec3560b7fd1ca76f1a0919
refs/heads/master: a093bde2b45a0a745f12c018e2d13c027d58641f
43 changes: 24 additions & 19 deletions trunk/drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,25 +557,6 @@ int clk_enable(struct clk *clk)
}
EXPORT_SYMBOL_GPL(clk_enable);

/**
* clk_get_rate - return the rate of clk
* @clk: the clk whose rate is being returned
*
* Simply returns the cached rate of the clk. Does not query the hardware. If
* clk is NULL then returns 0.
*/
unsigned long clk_get_rate(struct clk *clk)
{
unsigned long rate;

mutex_lock(&prepare_lock);
rate = __clk_get_rate(clk);
mutex_unlock(&prepare_lock);

return rate;
}
EXPORT_SYMBOL_GPL(clk_get_rate);

/**
* __clk_round_rate - round the given rate for a clk
* @clk: round the rate of this clock
Expand Down Expand Up @@ -701,6 +682,30 @@ static void __clk_recalc_rates(struct clk *clk, unsigned long msg)
__clk_recalc_rates(child, msg);
}

/**
* clk_get_rate - return the rate of clk
* @clk: the clk whose rate is being returned
*
* Simply returns the cached rate of the clk, unless CLK_GET_RATE_NOCACHE flag
* is set, which means a recalc_rate will be issued.
* If clk is NULL then returns 0.
*/
unsigned long clk_get_rate(struct clk *clk)
{
unsigned long rate;

mutex_lock(&prepare_lock);

if (clk && (clk->flags & CLK_GET_RATE_NOCACHE))
__clk_recalc_rates(clk, 0);

rate = __clk_get_rate(clk);
mutex_unlock(&prepare_lock);

return rate;
}
EXPORT_SYMBOL_GPL(clk_get_rate);

/**
* __clk_speculate_rates
* @clk: first clk in the subtree
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/clk-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */

struct clk_hw;

Expand Down

0 comments on commit d91e7cd

Please sign in to comment.