-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Update uart_mcux.c #50726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update uart_mcux.c #50726
Conversation
drivers/serial/uart_mcux.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are defining it but not binding to the driver instance. Define it inside the UART_MCUX_INIT loop and bind it to the instance. Basically, on DEVICE_DT_INST_DEFINE instead of NULL you pass PM_DEVICE_DT_INST_GET(n)
ceolin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot to send it ! Please address the comments and remove the merge commit. You just need the commit with your change.
drivers/serial/uart_mcux.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmahadevan108 can you check it please ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor issue, please fix the indentation of the break commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this bit keeps the UART clock running during low power modes. Should this be something the user gets to decide through a device tree property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another point is that we don't need to clear and enable this bit in suspend and resume. This is a one time operation where the user decides if the UART clock should be active in low power modes.
b3fc1c9 to
526aa1a
Compare
526aa1a to
b3b6240
Compare
drivers/serial/uart_mcux.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is not correct, what you have to do is;
#define UART_MCUX_INIT(n) \
PINCTRL_DEFINE(n) \
\
static struct uart_mcux_data uart_mcux_##n##_data = { \
.uart_cfg = { \
.stop_bits = UART_CFG_STOP_BITS_1, \
.data_bits = UART_CFG_DATA_BITS_8, \
.baudrate = DT_INST_PROP(n, current_speed), \
.parity = UART_CFG_PARITY_NONE, \
.flow_ctrl = DT_INST_PROP(n, hw_flow_control) ? \
UART_CFG_FLOW_CTRL_RTS_CTS : UART_CFG_FLOW_CTRL_NONE,\
}, \
}; \
\
static const struct uart_mcux_config uart_mcux_##n##_config; \
\
PM_DEVICE_DT_INST_DEFINE(n, uart_mcux_pm_action);\
DEVICE_DT_INST_DEFINE(n, \
&uart_mcux_init, \
PM_DEVICE_DT_INST_GET(n), \
&uart_mcux_##n##_data, \
&uart_mcux_##n##_config, \
PRE_KERNEL_1, \
CONFIG_SERIAL_INIT_PRIORITY, \
&uart_mcux_driver_api); \
\
UART_MCUX_CONFIG_FUNC(n) \
\
UART_MCUX_INIT_CFG(n);
DT_INST_FOREACH_STATUS_OKAY(UART_MCUX_INIT)
737cb97 to
c5e1506
Compare
c5e1506 to
62ff477
Compare
62ff477 to
1f7a893
Compare
118a0cd to
fcad698
Compare
293d50b to
2149dc9
Compare
edersondisouza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message doesn't make much sense. The bit " Using bit mask instead of individual bit
manipulation" appears to belong to an update of the PR. Just state what the patch does and any noteworthy stuff, if needed (like, stating that PM for this device means gating the clock for it).
2149dc9 to
728983b
Compare
Adding PM support to uart_mcux by gating clock and disabling transmitter Signed-off-by: Muhammed Ahmed <[email protected]>
728983b to
5948d05
Compare
adding pm support