type-c-service/tps6699x: Fix EPR capable flag not being set - #941
Conversation
There was a problem hiding this comment.
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-seteprfield. - Update
PortStatus.eprdoc 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. |
asasine
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_capsand validatessink_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.rdosays "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
This flag was not being set properly.
9456353 to
24177f0
Compare
|
Updated the available contract data structures to contain full PD information when available. This includes:
|
215e4aa
into
OpenDevicePartnership:stable-v0.1.y
This flag was not being set properly. Also add two more useful fields to
PortStatus.