Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260564
b: refs/heads/master
c: 52585cc
h: refs/heads/master
v: v3
  • Loading branch information
Haojian Zhuang authored and Eric Miao committed Jul 12, 2011
1 parent bb1e6c8 commit 300536b
Show file tree
Hide file tree
Showing 5 changed files with 33 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: 4e234cc0ee9db31d5b16b58d7c09af17246b2466
refs/heads/master: 52585ccd93d75e368382af09ae336ed8f231642c
15 changes: 15 additions & 0 deletions trunk/arch/arm/mach-mmp/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,18 @@ unsigned long clk_get_rate(struct clk *clk)
return rate;
}
EXPORT_SYMBOL(clk_get_rate);

int clk_set_rate(struct clk *clk, unsigned long rate)
{
unsigned long flags;
int ret = -EINVAL;

if (clk->ops->setrate) {
spin_lock_irqsave(&clocks_lock, flags);
ret = clk->ops->setrate(clk, rate);
spin_unlock_irqrestore(&clocks_lock, flags);
}

return ret;
}
EXPORT_SYMBOL(clk_set_rate);
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-mmp/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct clkops {
void (*enable)(struct clk *);
void (*disable)(struct clk *);
unsigned long (*getrate)(struct clk *);
int (*setrate)(struct clk *, unsigned long);
};

struct clk {
Expand Down
15 changes: 15 additions & 0 deletions trunk/arch/arm/mach-pxa/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ unsigned long clk_get_rate(struct clk *clk)
}
EXPORT_SYMBOL(clk_get_rate);

int clk_set_rate(struct clk *clk, unsigned long rate)
{
unsigned long flags;
int ret = -EINVAL;

if (clk->ops->setrate) {
spin_lock_irqsave(&clocks_lock, flags);
ret = clk->ops->setrate(clk, rate);
spin_unlock_irqrestore(&clocks_lock, flags);
}

return ret;
}
EXPORT_SYMBOL(clk_set_rate);

void clk_dummy_enable(struct clk *clk)
{
}
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-pxa/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct clkops {
void (*enable)(struct clk *);
void (*disable)(struct clk *);
unsigned long (*getrate)(struct clk *);
int (*setrate)(struct clk *, unsigned long);
};

struct clk {
Expand Down

0 comments on commit 300536b

Please sign in to comment.