Skip to content

Commit 2a98c59

Browse files
committed
--pdports: Only show alt mode bits if DP is active
I noticed that the HPD bit was set even on some adapters Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent a70ccce commit 2a98c59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

framework_lib/src/power.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,9 @@ pub fn get_and_print_cypd_pd_info(ec: &CrosEc) {
868868
if info.active_port != 0 { "Yes" } else { "No" }
869869
);
870870
let alt = info.pd_alt_mode_status;
871-
if connected && alt != 0 {
871+
// Bits 0-1 indicate DP alt mode is active (bit 0 = DFP_D/TBT,
872+
// bit 1 = UFP_D). Only show when actually in DP alt mode.
873+
if connected && (alt & 0x03) != 0 {
872874
let mut modes = vec![];
873875
if alt & 0x01 != 0 {
874876
modes.push("DFP_D Connected");

0 commit comments

Comments
 (0)