-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
spi: rtio: Refactor common SPI RTIO APIs to use across common drivers #77136
Merged
carlescufi
merged 4 commits into
zephyrproject-rtos:main
from
ubieda:ubieda/spi-rtio-refactor-common-apis
Sep 16, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
da7922d
spi: mcux_lpspi: Refactor driver to extract common RTIO functionality
ubieda f628a15
spi: spi_mcux_lpspi: Removed spin lock from iodev_start
ubieda 37b6ad1
spi: rtio: Extract common APIs into separate file
ubieda 48146dc
spi: rtio: Move spi_rtio_copy to spi_rtio
ubieda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 i2c_rtio_complete does much the same thing and returns true/false from what I recall to inform the driver whether more work should be started. Perhaps spi_rtio_complete could be an equivalent here.
That would reduce the code duplication further.
It's possible that i2c_rtio and spi_rtio do almost the same things entirely and could be converged into bus_rtio, with the blocking call wrappers still being done per bus type (as they each have their own call parameters). That sort of thing can be done after this though.
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.
Just a heads-up: I did come up with a spi_rtio_complete() (see further down); it's just that it's very limited as there's no handling of spi_context to perform
spi_context_cs_control()
calls.I can take another look to further optimize it.
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.
At a second pass, I find it a bit hard to optimize (without having
spi_rtio
deal with thespi_context
, or change the API signature to diverge fromi2c_rtio
's). May we explore this further optimization out of scope for this PR?BTW - I do agree we'd gain a lot from this bus_rtio refactoring.