Skip to content

Configure lpuart flow control pin mux #69899

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

Merged
merged 2 commits into from
Mar 12, 2024
Merged

Configure lpuart flow control pin mux #69899

merged 2 commits into from
Mar 12, 2024

Conversation

MarkWangChinese
Copy link
Collaborator

No description provided.

Configure the pins of flow control if it is added in device tree.

Signed-off-by: Mark Wang <[email protected]>
test configuring pin mux of lpuart flow control in RT1060

Signed-off-by: Mark Wang <[email protected]>
@zephyrbot zephyrbot added platform: NXP Drivers NXP Semiconductors, drivers area: UART Universal Asynchronous Receiver-Transmitter platform: NXP NXP labels Mar 7, 2024
@dcpleung dcpleung assigned dleach02 and unassigned dcpleung Mar 7, 2024
@fabiobaltieri fabiobaltieri merged commit c9467d8 into zephyrproject-rtos:main Mar 12, 2024
@bas-archembedded
Copy link
Contributor

@MarkWangChinese Doesn't this just check if the FLOWCONTROL state exists and never actually select it ?

@MarkWangChinese
Copy link
Collaborator Author

@MarkWangChinese Doesn't this just check if the FLOWCONTROL state exists and never actually select it ?

Sorry, I don't get your point, do you mean how to enable the uart flowcontrol? It is enabled by the DT that can be overwritten by overlay file.

@bas-archembedded
Copy link
Contributor

bas-archembedded commented Apr 21, 2025

@MarkWangChinese Doesn't this just check if the FLOWCONTROL state exists and never actually select it ?

Sorry, I don't get your point, do you mean how to enable the uart flowcontrol? It is enabled by the DT that can be overwritten by overlay file.

From what I read, err = pinctrl_lookup_state(config->pincfg, PINCTRL_STATE_FLOWCONTROL, &state); only looks up the state but it never actually transitions into that state anywhere ? IMHO this needs to be pinctrl_apply_state(config->pincfg, PINCTRL_STATE_FLOWCONTROL); ? pinctrl_apply_state() checks if the state is valid and if not returns error and in that case it will use "default" pinmux as the lpuart driver code then applies the default state.

@MarkWangChinese
Copy link
Collaborator Author

@MarkWangChinese Doesn't this just check if the FLOWCONTROL state exists and never actually select it ?

Sorry, I don't get your point, do you mean how to enable the uart flowcontrol? It is enabled by the DT that can be overwritten by overlay file.

From what I read, err = pinctrl_lookup_state(config->pincfg, PINCTRL_STATE_FLOWCONTROL, &state); only looks up the state but it never actually transitions into that state anywhere ? IMHO this needs to be pinctrl_apply_state(config->pincfg, PINCTRL_STATE_FLOWCONTROL); ? pinctrl_apply_state() checks if the state is valid and if not returns error and in that case it will use "default" pinmux as the lpuart driver code then applies the default state.

Yes, I think you are right, Thanks. The pinctrl_lookup_state should be replaced by pinctrl_apply_state through the static codes review. I remember that I did test with bluetooth audio sample. Will you create pr to fix it?

@bas-archembedded
Copy link
Contributor

@MarkWangChinese Doesn't this just check if the FLOWCONTROL state exists and never actually select it ?

Sorry, I don't get your point, do you mean how to enable the uart flowcontrol? It is enabled by the DT that can be overwritten by overlay file.

From what I read, err = pinctrl_lookup_state(config->pincfg, PINCTRL_STATE_FLOWCONTROL, &state); only looks up the state but it never actually transitions into that state anywhere ? IMHO this needs to be pinctrl_apply_state(config->pincfg, PINCTRL_STATE_FLOWCONTROL); ? pinctrl_apply_state() checks if the state is valid and if not returns error and in that case it will use "default" pinmux as the lpuart driver code then applies the default state.

Yes, I think you are right, Thanks. The pinctrl_lookup_state should be replaced by pinctrl_apply_state through the static codes review. I remember that I did test with bluetooth audio sample. Will you create pr to fix it?

I have created it here: #88866. Thanks for checking :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UART Universal Asynchronous Receiver-Transmitter platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants