mirror of
https://xff.cz/git/u-boot/
synced 2025-09-14 23:22:27 +02:00
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>
This commit is contained in:
committed by
Lukasz Majewski
parent
75551c8bfc
commit
2457612d6d
@@ -55,3 +55,11 @@ const char *clk_hw_get_name(const struct clk *hw)
|
|||||||
{
|
{
|
||||||
return hw->dev->name;
|
return hw->dev->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool clk_dev_binded(struct clk *clk)
|
||||||
|
{
|
||||||
|
if (clk->dev && (clk->dev->flags & DM_FLAG_BOUND))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@@ -356,4 +356,13 @@ static inline bool clk_valid(struct clk *clk)
|
|||||||
* @return zero on success, or -ENOENT on error
|
* @return zero on success, or -ENOENT on error
|
||||||
*/
|
*/
|
||||||
int clk_get_by_id(ulong id, struct clk **clkp);
|
int clk_get_by_id(ulong id, struct clk **clkp);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clk_dev_binded() - Check whether the clk has a device binded
|
||||||
|
*
|
||||||
|
* @clk A pointer to the clk
|
||||||
|
*
|
||||||
|
* @return true on binded, or false on no
|
||||||
|
*/
|
||||||
|
bool clk_dev_binded(struct clk *clk);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user