Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77486
b: refs/heads/master
c: 57c1b0f
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Jan 28, 2008
1 parent fdf12bb commit 8d1fa53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7275dac55008f8296cfb89a01b1e71918ac7995
refs/heads/master: 57c1b0f8dbfffaa00a242b171429e56489caef15
19 changes: 19 additions & 0 deletions trunk/arch/arm/plat-s3c24xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (IS_ERR(clk))
return -EINVAL;

/* We do not default just do a clk->rate = rate as
* the clock may have been made this way by choice.
*/

WARN_ON(clk->set_rate == NULL);

if (clk->set_rate == NULL)
return -EINVAL;

mutex_lock(&clocks_mutex);
ret = (clk->set_rate)(clk, rate);
mutex_unlock(&clocks_mutex);
Expand Down Expand Up @@ -213,6 +222,12 @@ EXPORT_SYMBOL(clk_set_parent);

/* base clocks */

static int clk_default_setrate(struct clk *clk, unsigned long rate)
{
clk->rate = rate;
return 0;
}

struct clk clk_xtal = {
.name = "xtal",
.id = -1,
Expand All @@ -224,6 +239,7 @@ struct clk clk_xtal = {
struct clk clk_mpll = {
.name = "mpll",
.id = -1,
.set_rate = clk_default_setrate,
};

struct clk clk_upll = {
Expand All @@ -239,6 +255,7 @@ struct clk clk_f = {
.rate = 0,
.parent = &clk_mpll,
.ctrlbit = 0,
.set_rate = clk_default_setrate,
};

struct clk clk_h = {
Expand All @@ -247,6 +264,7 @@ struct clk clk_h = {
.rate = 0,
.parent = NULL,
.ctrlbit = 0,
.set_rate = clk_default_setrate,
};

struct clk clk_p = {
Expand All @@ -255,6 +273,7 @@ struct clk clk_p = {
.rate = 0,
.parent = NULL,
.ctrlbit = 0,
.set_rate = clk_default_setrate,
};

struct clk clk_usb_bus = {
Expand Down

0 comments on commit 8d1fa53

Please sign in to comment.