clk: add clk_set_parent()
Clocks may support multiple parents: this change introduces an optional operation on the clk-uclass to set a clock's parent. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: David Wu <david.wu@rock-chips.com> Series-changes: 2 - Fixed David's email address.
This commit is contained in:
@@ -188,6 +188,18 @@ ulong clk_set_rate(struct clk *clk, ulong rate)
|
||||
return ops->set_rate(clk, rate);
|
||||
}
|
||||
|
||||
int clk_set_parent(struct clk *clk, struct clk *parent)
|
||||
{
|
||||
const struct clk_ops *ops = clk_dev_ops(clk->dev);
|
||||
|
||||
debug("%s(clk=%p, parent=%p)\n", __func__, clk, parent);
|
||||
|
||||
if (!ops->set_parent)
|
||||
return -ENOSYS;
|
||||
|
||||
return ops->set_parent(clk, parent);
|
||||
}
|
||||
|
||||
int clk_enable(struct clk *clk)
|
||||
{
|
||||
const struct clk_ops *ops = clk_dev_ops(clk->dev);
|
||||
|
||||
Reference in New Issue
Block a user