Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133320
b: refs/heads/master
c: d680c76
h: refs/heads/master
v: v3
  • Loading branch information
Francesco VIRLINZI authored and Paul Mundt committed Mar 11, 2009
1 parent 497e256 commit 7ff3073
Show file tree
Hide file tree
Showing 3 changed files with 31 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: 47a72688fae7298e1ad5fdc9bff7e04b6a549620
refs/heads/master: d680c76eccd9222031ee30dcee5fdedba2467610
1 change: 1 addition & 0 deletions trunk/arch/sh/include/asm/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct clk_ops {
void (*disable)(struct clk *clk);
void (*recalc)(struct clk *clk);
int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
int (*set_parent)(struct clk *clk, struct clk *parent);
long (*round_rate)(struct clk *clk, unsigned long rate);
};

Expand Down
29 changes: 29 additions & 0 deletions trunk/arch/sh/kernel/cpu/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,35 @@ void clk_recalc_rate(struct clk *clk)
}
EXPORT_SYMBOL_GPL(clk_recalc_rate);

int clk_set_parent(struct clk *clk, struct clk *parent)
{
int ret = -EINVAL;
struct clk *old;

if (!parent || !clk)
return ret;

old = clk->parent;
if (likely(clk->ops && clk->ops->set_parent)) {
unsigned long flags;
spin_lock_irqsave(&clock_lock, flags);
ret = clk->ops->set_parent(clk, parent);
spin_unlock_irqrestore(&clock_lock, flags);
clk->parent = (ret ? old : parent);
}

if (unlikely(clk->flags & CLK_RATE_PROPAGATES))
propagate_rate(clk);
return ret;
}
EXPORT_SYMBOL_GPL(clk_set_parent);

struct clk *clk_get_parent(struct clk *clk)
{
return clk->parent;
}
EXPORT_SYMBOL_GPL(clk_get_parent);

long clk_round_rate(struct clk *clk, unsigned long rate)
{
if (likely(clk->ops && clk->ops->round_rate)) {
Expand Down

0 comments on commit 7ff3073

Please sign in to comment.