mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
[ARM] 3331/1: S3C24XX - add clk_set_parent() to clock code
Patch from Ben Dooks Add clk_set_parent() call to clock code Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
8e40a2f91c
commit
d3468daab8
2 changed files with 20 additions and 0 deletions
|
@ -192,6 +192,23 @@ struct clk *clk_get_parent(struct clk *clk)
|
|||
return clk->parent;
|
||||
}
|
||||
|
||||
int clk_set_parent(struct clk *clk, struct clk *parent)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (IS_ERR(clk))
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&clocks_mutex);
|
||||
|
||||
if (clk->set_parent)
|
||||
ret = (clk->set_parent)(clk, parent);
|
||||
|
||||
mutex_unlock(&clocks_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(clk_get);
|
||||
EXPORT_SYMBOL(clk_put);
|
||||
EXPORT_SYMBOL(clk_enable);
|
||||
|
@ -200,6 +217,7 @@ EXPORT_SYMBOL(clk_get_rate);
|
|||
EXPORT_SYMBOL(clk_round_rate);
|
||||
EXPORT_SYMBOL(clk_set_rate);
|
||||
EXPORT_SYMBOL(clk_get_parent);
|
||||
EXPORT_SYMBOL(clk_set_parent);
|
||||
|
||||
/* base clock enable */
|
||||
|
||||
|
|
|
@ -19,7 +19,9 @@ struct clk {
|
|||
int usage;
|
||||
unsigned long rate;
|
||||
unsigned long ctrlbit;
|
||||
|
||||
int (*enable)(struct clk *, int enable);
|
||||
int (*set_parent)(struct clk *c, struct clk *parent);
|
||||
};
|
||||
|
||||
/* other clocks which may be registered by board support */
|
||||
|
|
Loading…
Reference in a new issue