diff options
author | Lukasz Majewski <lukma@denx.de> | 2019-06-24 15:50:43 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2019-07-19 14:50:30 +0200 |
commit | 4aa78300a025b7e09aa8e902b2178b1870ef1ec5 (patch) | |
tree | e687f90f042d8b4f44ab86f65525a393ca3c3d17 /include/clk.h | |
parent | 0c660c2b3263ba1d6e3c0dd43d813ef17b051207 (diff) | |
download | u-boot-4aa78300a025b7e09aa8e902b2178b1870ef1ec5.tar.gz |
dm: clk: Define clk_get_parent_rate() for clk operations
This commit adds the clk_get_parent_rate() function, which is responsible
for getting the rate of parent clock.
Unfortunately, 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 alleviate this problem - the clk_get_parent_rate() function has been
introduced to clk-uclass.c.
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.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clk.h b/include/clk.h index e20641ee98..7b2ff8ebe6 100644 --- a/include/clk.h +++ b/include/clk.h @@ -268,6 +268,15 @@ ulong clk_get_rate(struct clk *clk); struct clk *clk_get_parent(struct clk *clk); /** + * clk_get_parent_rate() - Get parent of current clock rate. + * + * @clk: A clock struct that was previously successfully requested by + * clk_request/get_by_*(). + * @return clock rate in Hz, or -ve error code. + */ +long long clk_get_parent_rate(struct clk *clk); + +/** * clk_set_rate() - Set current clock rate. * * @clk: A clock struct that was previously successfully requested by |