Skip to content

type-c-service/tps6699x: Fix EPR capable flag not being set - #941

Merged
RobertZ2011 merged 5 commits into
OpenDevicePartnership:stable-v0.1.yfrom
RobertZ2011:epr-flag-fix
Aug 12, 2026
Merged

type-c-service/tps6699x: Fix EPR capable flag not being set#941
RobertZ2011 merged 5 commits into
OpenDevicePartnership:stable-v0.1.yfrom
RobertZ2011:epr-flag-fix

Conversation

@RobertZ2011

@RobertZ2011 RobertZ2011 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This flag was not being set properly. Also add two more useful fields to PortStatus.

@RobertZ2011 RobertZ2011 self-assigned this Aug 7, 2026
@RobertZ2011
RobertZ2011 marked this pull request as ready for review August 7, 2026 16:12
@RobertZ2011
RobertZ2011 requested review from a team as code owners August 7, 2026 16:12
@RobertZ2011
RobertZ2011 requested review from asasine, gjpmsft, jerrysxie, kurtjd, tullom and williampMSFT and a lite review from Copilot August 7, 2026 16:12
@RobertZ2011 RobertZ2011 added bug Something isn't working type-c Related to the type-c service or drivers. labels Aug 7, 2026

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 fixes PortStatus.epr not being populated when using the TPS6699x Type‑C/PD controller driver, by extracting the EPR-capable bit from the partner’s first received Source PDO (the 5V fixed SPR PDO). It also updates the PortStatus field documentation to describe epr as “port partner is EPR capable”. The intent is to make the EPR capability visible to higher layers that consume PortStatus.

Changes:

  • Parse the first received Source PDO as a fixed PDO and use its flags to populate dual_power, unconstrained_power, and the newly-set epr field.
  • Update PortStatus.epr doc comment to reflect “port partner is EPR capable”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
type-c-service/src/driver/tps6699x.rs Sets PortStatus.epr (and refactors related flag extraction) based on the first received fixed Source PDO.
embedded-service/src/type_c/controller.rs Updates the documentation describing what PortStatus.epr represents.

Comment thread embedded-service/src/type_c/controller.rs Outdated
asasine
asasine previously approved these changes Aug 7, 2026
Comment thread type-c-service/src/driver/tps6699x.rs Outdated
kurtjd
kurtjd previously approved these changes Aug 7, 2026
@RobertZ2011
RobertZ2011 dismissed stale reviews from kurtjd and asasine via 7f74126 August 7, 2026 18:12
@RobertZ2011
RobertZ2011 requested review from asasine and kurtjd August 7, 2026 18:17
asasine
asasine previously approved these changes Aug 7, 2026

@asasine asasine 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.

The whole PDO would avoid ambiguity with what each field refers to, and would save us from needing to revisit this again for yet-another-field.

kurtjd
kurtjd previously approved these changes Aug 7, 2026
@RobertZ2011
RobertZ2011 marked this pull request as draft August 7, 2026 23:50
@RobertZ2011
RobertZ2011 dismissed stale reviews from kurtjd and asasine via 492eced August 10, 2026 21:02
@RobertZ2011
RobertZ2011 requested a lite review from Copilot August 10, 2026 21:03

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (2)

type-c-service/src/driver/tps6699x.rs:358

  • Error message is incorrect for the sink-capabilities read path: this branch calls get_rx_snk_caps and validates sink_pdos, but logs "no source PDOs found". This makes debugging confusing when a partner reports no sink PDOs.
                        error!("Port{} no source PDOs found", port.0);

embedded-service/src/type_c/controller.rs:99

  • Doc comment for PdSinkInfo.rdo says "PDO" but the field is an RDO (pdo::Rdo). This is misleading for users trying to understand what the struct contains.
    /// PDO associated with this contract

Comment thread embedded-service/src/type_c/controller.rs
@RobertZ2011
RobertZ2011 marked this pull request as ready for review August 11, 2026 17:30
@RobertZ2011

Copy link
Copy Markdown
Contributor Author

Updated the available contract data structures to contain full PD information when available. This includes:

  • PDO and RDO for the negotiated contract
  • Flags from fixed 5V PDO, these apply to all PDOs but they're only set in this PDO.

@RobertZ2011
RobertZ2011 requested review from asasine and kurtjd August 11, 2026 20:44
@RobertZ2011
RobertZ2011 merged commit 215e4aa into OpenDevicePartnership:stable-v0.1.y Aug 12, 2026
15 checks passed
@RobertZ2011
RobertZ2011 deleted the epr-flag-fix branch August 12, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working type-c Related to the type-c service or drivers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants