pd: add flags to pd state console command

Add PD flags to pd <port> state console command

BUG=none
BRANCH=samus
TEST=load on samus and call pd <port> state.

Change-Id: I490c7c5ae942a0f4e3f64c24e22ef3470edec641
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/238962
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Alec Berg
2015-01-06 17:36:16 -08:00
committed by ChromeOS Commit Bot
parent e95f24ce52
commit b10629ea35

View File

@@ -2871,17 +2871,12 @@ static int command_pd(int argc, char **argv)
};
BUILD_ASSERT(ARRAY_SIZE(state_names) == PD_STATE_COUNT);
ccprintf("Port C%d, %s - Role: %s-%s Polarity: CC%d "
"Contract: %s, Partner: %s%s, State: %s\n",
"Flags: 0x%04x, State: %s\n",
port, pd_comm_enabled ? "Ena" : "Dis",
pd[port].power_role == PD_ROLE_SOURCE ? "SRC" : "SNK",
pd[port].data_role == PD_ROLE_DFP ? "DFP" : "UFP",
pd[port].polarity + 1,
pd[port].flags & PD_FLAGS_EXPLICIT_CONTRACT ?
"Yes" : "No",
(pd[port].flags & PD_FLAGS_PARTNER_DR_POWER) ?
"PR_SWAP," : "",
(pd[port].flags & PD_FLAGS_PARTNER_DR_DATA) ?
"DR_SWAP" : "",
pd[port].flags,
state_names[pd[port].task_state]);
} else {
return EC_ERROR_PARAM1;