From b10629ea35ccfc39b9d591e5ccc47ef1e269e132 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Tue, 6 Jan 2015 17:36:16 -0800 Subject: [PATCH] pd: add flags to pd state console command Add PD flags to pd state console command BUG=none BRANCH=samus TEST=load on samus and call pd state. Change-Id: I490c7c5ae942a0f4e3f64c24e22ef3470edec641 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/238962 Reviewed-by: Vincent Palatin --- common/usb_pd_protocol.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index bc9ecf98e6..6915ff2f5c 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -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;