mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-05-25 05:05:35 +08:00
[dm][core] Set default CLK config for platform device probe
Signed-off-by: GuEe-GUI <2991707448@qq.com>
This commit is contained in:
@@ -15,6 +15,9 @@
|
|||||||
#define DBG_LVL DBG_INFO
|
#define DBG_LVL DBG_INFO
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
|
#ifdef RT_USING_CLK
|
||||||
|
#include <drivers/clk.h>
|
||||||
|
#endif
|
||||||
#include <drivers/platform.h>
|
#include <drivers/platform.h>
|
||||||
#include <drivers/core/bus.h>
|
#include <drivers/core/bus.h>
|
||||||
#include <drivers/core/dm.h>
|
#include <drivers/core/dm.h>
|
||||||
@@ -119,6 +122,13 @@ static rt_err_t platform_probe(rt_device_t dev)
|
|||||||
struct rt_ofw_node *np = dev->ofw_node;
|
struct rt_ofw_node *np = dev->ofw_node;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef RT_USING_CLK
|
||||||
|
if ((err = rt_ofw_clk_set_defaults(dev->ofw_node)))
|
||||||
|
{
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
err = rt_dm_power_domain_attach(dev, RT_TRUE);
|
err = rt_dm_power_domain_attach(dev, RT_TRUE);
|
||||||
|
|
||||||
if (err && err != -RT_EEMPTY)
|
if (err && err != -RT_EEMPTY)
|
||||||
|
|||||||
Reference in New Issue
Block a user