Skip to content

Commit 67860c9

Browse files
committed
--pdports: Clarify port partner type
Type-C state is the state of the port partner. And hide that information if no PD contract. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent e17c68f commit 67860c9

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

EXAMPLES.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ Alongside a 65W SDR adapter - which is not active, because the EC firmware switc
736736

737737
```
738738
USB-C Port 0:
739-
Type-C State: Source
739+
Port Partner: Source
740740
PD Contract: Yes
741741
Power Role: Sink
742742
Data Role: Dfp
@@ -746,7 +746,7 @@ USB-C Port 0:
746746
CC Polarity: CC1
747747
Active Port: Yes
748748
USB-C Port 1:
749-
Type-C State: Source
749+
Port Partner: Source
750750
PD Contract: Yes
751751
Power Role: Sink
752752
Data Role: Ufp
@@ -761,7 +761,7 @@ A 100W SDR power adapter connected:
761761

762762
```
763763
USB-C Port 0:
764-
Type-C State: Source
764+
Port Partner: Source
765765
PD Contract: Yes
766766
Power Role: Sink
767767
Data Role: Ufp
@@ -776,7 +776,7 @@ A 65W (Framework) power adapter connected:
776776

777777
```
778778
USB-C Port 0:
779-
Type-C State: Source
779+
Port Partner: Source
780780
PD Contract: Yes
781781
Power Role: Sink
782782
Data Role: Dfp
@@ -793,7 +793,6 @@ A USB2/3 device connected (even USB-A Expansion Card):
793793

794794
```
795795
USB-C Port 2:
796-
Type-C State: Sink
797796
PD Contract: No
798797
Power Role: Source
799798
Data Role: Dfp
@@ -808,7 +807,7 @@ A Display connected through Framework DisplayPort Expansion card:
808807

809808
```
810809
USB-C Port 1:
811-
Type-C State: Sink
810+
Port Partner: Sink
812811
PD Contract: Yes
813812
Power Role: Source
814813
Data Role: Dfp
@@ -824,7 +823,6 @@ Nothing connected (or Type-C Expansion Card):
824823

825824
```
826825
USB-C Port 3:
827-
Type-C State: Nothing
828826
PD Contract: No
829827
Power Role: Sink
830828
Data Role: Ufp

framework_lib/src/power.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,9 @@ pub fn get_and_print_cypd_pd_info(ec: &CrosEc) {
798798
let current = { info.current };
799799
let watts_mw = voltage as u32 * current as u32 / 1000;
800800

801-
println!(" Type-C State: {:?}", c_state);
801+
if info.pd_state {
802+
println!(" Port Partner: {:?}", c_state);
803+
}
802804
println!(
803805
" PD Contract: {}",
804806
if info.pd_state != 0 { "Yes" } else { "No" }

0 commit comments

Comments
 (0)