summaryrefslogtreecommitdiff
path: root/include/clk.h
diff options
context:
space:
mode:
authorLukasz Majewski <lukma@denx.de>2019-06-24 15:50:42 +0200
committerStefano Babic <sbabic@denx.de>2019-07-19 14:50:30 +0200
commit0c660c2b3263ba1d6e3c0dd43d813ef17b051207 (patch)
treebe80c91406720ce01e81b70c6692733e14e35e98 /include/clk.h
parent004c1229414ff4a13dd20f48f9c8c1da98fee878 (diff)
downloadu-boot-0c660c2b3263ba1d6e3c0dd43d813ef17b051207.tar.gz
dm: clk: Define clk_get_parent() for clk operations
This commit adds the clk_get_parent() function, which is responsible for getting the parent's struct clock pointer. U-Boot's DM support for getting parent is different (the parent relationship is in udevice) than the one in Common Clock Framework [CCF] in Linux. To obtain the pointer to struct clk of parent the pdev->uclass_priv field is read via dev_get_clk_ptr() wrapper. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'include/clk.h')
-rw-r--r--include/clk.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clk.h b/include/clk.h
index b10c0013b1..e20641ee98 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -259,6 +259,15 @@ int clk_free(struct clk *clk);
ulong clk_get_rate(struct clk *clk);
/**
+ * clk_get_parent() - Get current clock's parent.
+ *
+ * @clk: A clock struct that was previously successfully requested by
+ * clk_request/get_by_*().
+ * @return pointer to parent's struct clk, or error code passed as pointer
+ */
+struct clk *clk_get_parent(struct clk *clk);
+
+/**
* clk_set_rate() - Set current clock rate.
*
* @clk: A clock struct that was previously successfully requested by