Skip to content

Commit 6270b2f

Browse files
GuEe-GUIRbb666
authored andcommitted
[dm][core] Set default CLK config for platform device probe
Signed-off-by: GuEe-GUI <[email protected]>
1 parent 335a124 commit 6270b2f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/drivers/core/platform.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#define DBG_LVL DBG_INFO
1616
#include <rtdbg.h>
1717

18+
#ifdef RT_USING_CLK
19+
#include <drivers/clk.h>
20+
#endif
1821
#include <drivers/platform.h>
1922
#include <drivers/core/bus.h>
2023
#include <drivers/core/dm.h>
@@ -119,6 +122,13 @@ static rt_err_t platform_probe(rt_device_t dev)
119122
struct rt_ofw_node *np = dev->ofw_node;
120123
#endif
121124

125+
#ifdef RT_USING_CLK
126+
if ((err = rt_ofw_clk_set_defaults(dev->ofw_node)))
127+
{
128+
return err;
129+
}
130+
#endif
131+
122132
err = rt_dm_power_domain_attach(dev, RT_TRUE);
123133

124134
if (err && err != -RT_EEMPTY)

0 commit comments

Comments
 (0)