Skip to content
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

[TOPIC-GPIO] drivers: gpio_mcux: Fix handling of disconnect configuration #19556

Closed
wants to merge 1 commit into from

Conversation

galak
Copy link
Collaborator

@galak galak commented Oct 2, 2019

If the gpio flags are passed such that neither GPIO_INPUT or GPIO_OUTPUT
is set, we should treat this as a disconnected state. Change the config
code to handle that configuration as a GPIO_INPUT so we aren't
accidently driving something on the pin.

Signed-off-by: Kumar Gala [email protected]

If the gpio flags are passed such that neither GPIO_INPUT or GPIO_OUTPUT
is set, we should treat this as a disconnected state.  Change the config
code to handle that configuration as a GPIO_INPUT so we aren't
accidently driving something on the pin.

Signed-off-by: Kumar Gala <[email protected]>
@galak galak requested a review from pabigot October 2, 2019 20:53
@galak
Copy link
Collaborator Author

galak commented Oct 2, 2019

@MaureenHelm its not clear to me if this change makes sense, or if we should treat (!GPIO_INPUT && !GPIO_OUTPUT) as an unsupported config options and return -ENOSUP.

@galak galak changed the title drivers: gpio_mcux: Fix handling of disconnect configuration [TOPIC-GPIO] drivers: gpio_mcux: Fix handling of disconnect configuration Oct 2, 2019
Copy link
Collaborator

@pabigot pabigot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I read K64P144M120SF5RM.pdf (section 55.3.2) a pin configured for GPIO must be either an input or an output. If that's true, then -ENOTSUP should be returned unless exactly one of GPIO_INPUT and GPIO_OUTPUT is set.

Based on that I'll have to change the 2-pin test to fall back to setting the output pin as input rather than disconnected.

@galak
Copy link
Collaborator Author

galak commented Oct 2, 2019

Closing this as @pabigot PR makes sense to me. Will leave it up to @MaureenHelm to state otherwise.

@galak galak closed this Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants