Skip to content

type-c-service/tps6699x: Fix sink PDO ordering bug - #943

Merged
RobertZ2011 merged 1 commit into
OpenDevicePartnership:stable-v0.1.yfrom
RobertZ2011:fix-sink-pdos-not-yet-available
Aug 14, 2026
Merged

type-c-service/tps6699x: Fix sink PDO ordering bug#943
RobertZ2011 merged 1 commit into
OpenDevicePartnership:stable-v0.1.yfrom
RobertZ2011:fix-sink-pdos-not-yet-available

Conversation

@RobertZ2011

Copy link
Copy Markdown
Contributor

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.

@RobertZ2011 RobertZ2011 self-assigned this Aug 12, 2026
@RobertZ2011
RobertZ2011 force-pushed the fix-sink-pdos-not-yet-available branch 8 times, most recently from 196fd0c to 42bccf2 Compare August 13, 2026 15:42
@RobertZ2011
RobertZ2011 requested a lite review from Copilot August 13, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_data optional and update SourceContract helpers 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.

Comment thread type-c-service/src/driver/tps6699x.rs Outdated
Comment thread embedded-service/src/type_c/controller.rs
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
RobertZ2011 force-pushed the fix-sink-pdos-not-yet-available branch from 42bccf2 to c859478 Compare August 13, 2026 20:51
@RobertZ2011
RobertZ2011 marked this pull request as ready for review August 13, 2026 21:26
@RobertZ2011
RobertZ2011 requested review from a team as code owners August 13, 2026 21:26
@RobertZ2011
RobertZ2011 merged commit 65f7e22 into OpenDevicePartnership:stable-v0.1.y Aug 14, 2026
15 checks passed
@RobertZ2011
RobertZ2011 deleted the fix-sink-pdos-not-yet-available branch August 14, 2026 18:23

@jerrysxie jerrysxie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@RobertZ2011 Do we want to add a test case that covers this order?

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.

5 participants