From 1b4111a99e63cc731a51da9459e24b02692aa768 Mon Sep 17 00:00:00 2001 From: GUI <39894654+GuEe-GUI@users.noreply.github.com> Date: Sat, 13 Dec 2025 16:33:05 +0800 Subject: [PATCH] [dm][pinctrl] Set pinctrl default auto in platform bus. (#11052) Signed-off-by: GuEe-GUI <2991707448@qq.com> --- components/drivers/core/platform.c | 8 ++++++++ components/drivers/serial/dev_serial.c | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/drivers/core/platform.c b/components/drivers/core/platform.c index d308dd0806..48b7077a03 100644 --- a/components/drivers/core/platform.c +++ b/components/drivers/core/platform.c @@ -18,6 +18,7 @@ #ifdef RT_USING_CLK #include #endif +#include #include #include #include @@ -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))) { diff --git a/components/drivers/serial/dev_serial.c b/components/drivers/serial/dev_serial.c index 3ebe3063ac..45bf97c328 100644 --- a/components/drivers/serial/dev_serial.c +++ b/components/drivers/serial/dev_serial.c @@ -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) {