Skip to content

type-c-service/controller: Create customization trait#918

Open
RobertZ2011 wants to merge 1 commit into
OpenDevicePartnership:mainfrom
RobertZ2011:type-c-customization
Open

type-c-service/controller: Create customization trait#918
RobertZ2011 wants to merge 1 commit into
OpenDevicePartnership:mainfrom
RobertZ2011:type-c-customization

Conversation

@RobertZ2011

Copy link
Copy Markdown
Contributor

No description provided.

@RobertZ2011 RobertZ2011 self-assigned this Jul 9, 2026
@RobertZ2011
RobertZ2011 force-pushed the type-c-customization branch 2 times, most recently from 1245fab to be8b004 Compare July 20, 2026 16:45
@RobertZ2011
RobertZ2011 requested a review from Copilot July 20, 2026 16:54

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 introduces an OEM customization hook for the Type-C controller Port by adding a Customization trait and making Port generic over a customization implementation (defaulting to DefaultCustomization). The main behavioral change is that consumer power capability flags (notably unconstrained power) are now derived via the customization layer rather than directly from controller config. As part of this, the previous controller::config::Config content is removed and an explicit Port::with_customization(...) constructor is added for injecting non-default customization.

Changes:

  • Add controller::customization module defining Customization, DefaultCustomization, and UnconstrainedSink.
  • Make controller::Port generic over a Customization implementation (defaulted) and thread it through controller trait impls.
  • Route consumer capability updates through Customization::update_consumer_capability(...) during sink contract processing.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
type-c-service/src/controller/mod.rs Adds customization module, extends Port with a Customization type param + field, and introduces with_customization constructor.
type-c-service/src/controller/customization.rs New customization trait + default implementation and migrated unconstrained-sink behavior.
type-c-service/src/controller/config.rs Removes prior config fields; Config becomes an empty placeholder type.
type-c-service/src/controller/power.rs Uses customization hook to update ConsumerPowerCapability during new consumer contract handling.
type-c-service/src/controller/pd.rs Updates Port impl blocks to include the new Customization generic parameter.
type-c-service/src/controller/type_c.rs Updates StateMachine impl to include the new Customization generic parameter.
type-c-service/src/controller/retimer.rs Updates Retimer impl to include the new Customization generic parameter.
type-c-service/src/controller/ucsi.rs Updates Lpm impl to include the new Customization generic parameter.
type-c-service/src/controller/max_sink_voltage.rs Updates MaxSinkVoltage impl to include the new Customization generic parameter.
type-c-service/src/controller/electrical_disconnect.rs Updates ElectricalDisconnect impl to include the new Customization generic parameter.

Comment thread type-c-service/src/controller/mod.rs
Comment thread type-c-service/src/controller/power.rs
Comment thread type-c-service/src/controller/power.rs Outdated
@RobertZ2011
RobertZ2011 force-pushed the type-c-customization branch from be8b004 to 98e7014 Compare July 20, 2026 17:42
@RobertZ2011
RobertZ2011 marked this pull request as ready for review July 20, 2026 18:06
@RobertZ2011
RobertZ2011 requested a review from a team as a code owner July 20, 2026 18:06
@RobertZ2011
RobertZ2011 force-pushed the type-c-customization branch from 98e7014 to 4f0d399 Compare July 20, 2026 23:17
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.

2 participants