[dm][pinctrl] Set pinctrl default auto in platform bus. (#11052)

Signed-off-by: GuEe-GUI <2991707448@qq.com>
This commit is contained in:
GUI
2025-12-13 16:33:05 +08:00
committed by GitHub
parent d8709ba9fb
commit 1b4111a99e
2 changed files with 8 additions and 5 deletions

View File

@@ -18,6 +18,7 @@
#ifdef RT_USING_CLK
#include <drivers/clk.h>
#endif
#include <drivers/dev_pin.h>
#include <drivers/platform.h>
#include <drivers/core/bus.h>
#include <drivers/core/dm.h>
@@ -122,6 +123,13 @@ static rt_err_t platform_probe(rt_device_t dev)
struct rt_ofw_node *np = dev->ofw_node;
#endif
#ifdef RT_USING_PINCTRL
if (rt_pin_ctrl_confs_apply_by_name(dev, RT_NULL))
{
rt_pin_ctrl_confs_apply(dev, 0);
}
#endif
#ifdef RT_USING_CLK
if ((err = rt_ofw_clk_set_defaults(dev->ofw_node)))
{

View File

@@ -664,11 +664,6 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
/* get open flags */
dev->open_flag = oflag & 0xff;
#ifdef RT_USING_PINCTRL
/* initialize iomux in DM */
rt_pin_ctrl_confs_apply_by_name(dev, RT_NULL);
#endif
/* initialize the Rx/Tx structure according to open flag */
if (serial->serial_rx == RT_NULL)
{