Skip to content

Commit 1a1c25e

Browse files
committed
[DM/PLATFORM] Make pinctrl default apply auto
Drivers unknow if should apply pinctrl when probe as SoC implement is different. We apply "default" auto before they probe, drivers apply pinctrl default is not necessary from now on. Signed-off-by: GuEe-GUI <[email protected]>
1 parent 79ebb83 commit 1a1c25e

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

components/drivers/core/platform.c

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

18+
#include <drivers/dev_pin.h>
1819
#include <drivers/platform.h>
1920
#include <drivers/core/bus.h>
2021
#include <drivers/core/dm.h>
@@ -134,6 +135,10 @@ static rt_err_t platform_probe(rt_device_t dev)
134135
return err;
135136
}
136137

138+
#ifdef RT_USING_PINCTRL
139+
rt_pin_ctrl_confs_apply_by_name(dev, RT_NULL);
140+
#endif
141+
137142
err = pdrv->probe(pdev);
138143

139144
if (!err)

components/drivers/led/led-gpio.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ static rt_err_t gpio_led_probe(struct rt_platform_device *pdev)
153153
if (rt_ofw_prop_read_bool(np, "pinctrl-0"))
154154
{
155155
pinctrl_apply = RT_TRUE;
156-
rt_pin_ctrl_confs_apply_by_name(&pdev->parent, RT_NULL);
157156
}
158157

159158
rt_ofw_foreach_available_child_node(np, led_np)

components/drivers/regulator/regulator-fixed.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ static rt_err_t regulator_fixed_probe(struct rt_platform_device *pdev)
123123
rf->enable_pin = -1;
124124
}
125125

126-
rt_pin_ctrl_confs_apply(dev, 0);
127-
128126
if (!rt_dm_dev_prop_read_u32(dev, "startup-delay-us", &val))
129127
{
130128
rf->param.enable_delay = val;

components/drivers/serial/dev_serial.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,6 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
664664
/* get open flags */
665665
dev->open_flag = oflag & 0xff;
666666

667-
#ifdef RT_USING_PINCTRL
668-
/* initialize iomux in DM */
669-
rt_pin_ctrl_confs_apply_by_name(dev, RT_NULL);
670-
#endif
671-
672667
/* initialize the Rx/Tx structure according to open flag */
673668
if (serial->serial_rx == RT_NULL)
674669
{

0 commit comments

Comments
 (0)