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

drivers: i3c: add i3c-rtio #80177

Merged
merged 5 commits into from
Dec 16, 2024

Conversation

XenuIsWatching
Copy link
Member

This adds support for i3c RTIO along with adding the default calls for i3c (and i2c) for all the i3c drivers

This is heavily based of the i2c default handler. #79890

teburd
teburd previously approved these changes Nov 18, 2024
Copy link
Collaborator

@teburd teburd left a comment

Choose a reason for hiding this comment

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

One remark on the CCC functionality (unfamiliar with it!) that maybe could be const correct or not depending on the answer, approved regardless.


/** OP_I3C_CCC */
/* struct i3c_ccc_payload *ccc_payload; */
void *ccc_payload;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the payload mutable? Should potentially be const?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes... there is a num_xfer with in there to return the 'true' number of bytes actually sent/received as the target can control when the End of Data occurs.... but I should probably remove this as I was trying to integrate the do_ccc in to the rtio... but gave up for now

Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds like some more fun things to look at in the future for sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah... thinking more about it I think i'll just keep it in for now.

/* Try for next submission in the transaction */
ctx->txn_curr = rtio_txn_next(ctx->txn_curr);
if (ctx->txn_curr) {
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

So in this case the sqe does not get completed neither with 'ok' nor with 'err'. Is this correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would assume so?? i2c_rtio.c is doing the exact same thing

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes yes, but still I don't get it. But the code seems well written, so there should be a reason I'm not 100% getting

Copy link
Member Author

@XenuIsWatching XenuIsWatching Dec 3, 2024

Choose a reason for hiding this comment

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

I'm not really sure either... I'm being rather a coding monkey 🐵 here and copied most of the i2c_rtio.c, but only understanding just enough to make it work with i3c. Perhaps @teburd would know as the original author?

Copy link
Collaborator

@teburd teburd Dec 16, 2024

Choose a reason for hiding this comment

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

Transactions should result in one completion, either the transaction succeeds or fails. Akin to calling i2c_transfer you only know the result of the full operation not the individual sends/recvs

avisconti
avisconti previously approved these changes Dec 5, 2024
Copy link
Collaborator

@avisconti avisconti left a comment

Choose a reason for hiding this comment

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

I don't see big mistakes and approve the PR. The only doubt has been left not clarified yet. Maybe @teburd can give his own opinion.

This adds rtio along with a default handler for i3c

Signed-off-by: Ryan McClelland <[email protected]>
add api calls for the default handlers for i2c and i3c rtio

Signed-off-by: Ryan McClelland <[email protected]>
add api calls for the default handlers for i2c and i3c rtio

Signed-off-by: Ryan McClelland <[email protected]>
add api calls for the default handlers for i3c rtio

Signed-off-by: Ryan McClelland <[email protected]>
add api calls for the default handlers for i3c rtio

Signed-off-by: Ryan McClelland <[email protected]>
@kartben kartben merged commit f888e78 into zephyrproject-rtos:main Dec 16, 2024
26 checks passed
ndrs-pst added a commit to DDC-NDRS/zephyr_rtos that referenced this pull request Dec 17, 2024
The `_resv0` field is no longer needed after increasing the size of
`iodev_flags` from `uint16_t` to `uint32_t` by this PR zephyrproject-rtos#80177.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants