type-c-service/tps6699x: Fix sink PDO ordering bug - #943
Merged
RobertZ2011 merged 1 commit intoAug 14, 2026
Merged
Conversation
RobertZ2011
force-pushed
the
fix-sink-pdos-not-yet-available
branch
8 times, most recently
from
August 13, 2026 15:42
196fd0c to
42bccf2
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the TPS6699x Type-C/USB-PD controller implementation to tolerate cases where a PD contract is negotiated before the sink capabilities (sink PDOs) have been received, by making the received “fixed 5V sink PDO flags” optional instead of mandatory.
Changes:
- Make
PdSourceInfo.rx_fixed_5v_dataoptional and updateSourceContracthelpers to handle missing data. - Adjust TPS6699x contract reporting logic to avoid failing when sink PDOs are not yet available.
- Update mocks used by tests and the std example to populate the now-optional field.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| type-c-service/src/driver/tps6699x.rs | Adjusts contract reporting to not error when sink caps aren’t received yet (but needs a fix to correctly detect the “not received” case). |
| embedded-service/src/type_c/controller.rs | Changes PdSourceInfo API to store optional sink 5V fixed data and updates flag accessors accordingly. |
| type-c-service/tests/common/mock.rs | Updates test mocks to set rx_fixed_5v_data: Some(...). |
| examples/std/src/lib/type_c/mock_controller.rs | Updates std example mock controller to set rx_fixed_5v_data: Some(...). |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Unlike the source PDOs, we are not guranteed to have received sink PDOs by the time we've negotiated a contract. Don't return an error when this happens and update structs to make the fixed 5v field an `Option`.
RobertZ2011
force-pushed
the
fix-sink-pdos-not-yet-available
branch
from
August 13, 2026 20:51
42bccf2 to
c859478
Compare
RobertZ2011
marked this pull request as ready for review
August 13, 2026 21:26
RobertZ2011
requested review from
asasine,
felipebalbi,
gjpmsft,
jerrysxie,
tullom and
williampMSFT
August 13, 2026 21:26
asasine
approved these changes
Aug 13, 2026
tullom
approved these changes
Aug 14, 2026
RobertZ2011
merged commit Aug 14, 2026
65f7e22
into
OpenDevicePartnership:stable-v0.1.y
15 checks passed
jerrysxie
reviewed
Aug 14, 2026
Contributor
There was a problem hiding this comment.
@RobertZ2011 Do we want to add a test case that covers this order?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Unlike the source PDOs, we are not guranteed to have received sink PDOs by the time we've negotiated a contract. Don't return an error when this happens.