From f7d1046da18fd03a047b5f4d290a8ab8550ebf73 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Mon, 8 Jan 2018 11:15:08 +0100 Subject: 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 Tested-by: David Wu Series-changes: 2 - Fixed David's email address. --- include/clk.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/clk.h') diff --git a/include/clk.h b/include/clk.h index e7ce3e8576..e463d8e60d 100644 --- a/include/clk.h +++ b/include/clk.h @@ -177,6 +177,17 @@ ulong clk_get_rate(struct clk *clk); */ ulong clk_set_rate(struct clk *clk, ulong rate); +/** + * clk_set_parent() - Set current clock parent. + * + * @clk: A clock struct that was previously successfully requested by + * clk_request/get_by_*(). + * @parent: A clock struct that was previously successfully requested by + * clk_request/get_by_*(). + * @return new rate, or -ve error code. + */ +int clk_set_parent(struct clk *clk, struct clk *parent); + /** * clk_enable() - Enable (turn on) a clock. * -- cgit v1.2.3