Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173310
b: refs/heads/master
c: b82a51e
h: refs/heads/master
v: v3
  • Loading branch information
Sekhar Nori authored and Kevin Hilman committed Nov 25, 2009
1 parent 415cc65 commit 59e25db
Show file tree
Hide file tree
Showing 2 changed files with 28 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: d6a61563f9e934ef20a1338780082f63802c8908
refs/heads/master: b82a51e8ce560fece675b8e3ca652eee26a47789
27 changes: 27 additions & 0 deletions trunk/arch/arm/mach-davinci/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,33 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
}
EXPORT_SYMBOL(clk_set_rate);

int clk_set_parent(struct clk *clk, struct clk *parent)
{
unsigned long flags;

if (clk == NULL || IS_ERR(clk))
return -EINVAL;

/* Cannot change parent on enabled clock */
if (WARN_ON(clk->usecount))
return -EINVAL;

mutex_lock(&clocks_mutex);
clk->parent = parent;
list_del_init(&clk->childnode);
list_add(&clk->childnode, &clk->parent->children);
mutex_unlock(&clocks_mutex);

spin_lock_irqsave(&clockfw_lock, flags);
if (clk->recalc)
clk->rate = clk->recalc(clk);
propagate_rate(clk);
spin_unlock_irqrestore(&clockfw_lock, flags);

return 0;
}
EXPORT_SYMBOL(clk_set_parent);

int clk_register(struct clk *clk)
{
if (clk == NULL || IS_ERR(clk))
Expand Down

0 comments on commit 59e25db

Please sign in to comment.