aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorPeng Fan2019-07-31 07:01:23 +0000
committerLukasz Majewski2019-07-31 09:20:51 +0200
commit2457612d6d374bd67d3317f11cf24fc0bba02274 (patch)
tree9d5d91776eeb330d7fe1677b465f6b68940a563c /drivers/clk
parent75551c8bfc9545e31ec2ce238cac3857904007b8 (diff)
clk: introduce clk_dev_binded
When support Clock Common Framework, U-Boot use dev for clk tree information, there is no clk->parent. When support composite clk, it contains mux/gate/divider, but the mux/gate/divider is not binded with device. So we could not use dev_get_uclass_priv to get the correct clk_mux/gate/divider. So add clk_dev_binded to let choose the correct method. Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7d748c9fc73..39b3087067a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -55,3 +55,11 @@ const char *clk_hw_get_name(const struct clk *hw)
{
return hw->dev->name;
}
+
+bool clk_dev_binded(struct clk *clk)
+{
+ if (clk->dev && (clk->dev->flags & DM_FLAG_BOUND))
+ return true;
+
+ return false;
+}