summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/usb_pd_protocol.c3
-rw-r--r--include/ec_commands.h2
-rw-r--r--util/ectool.c5
3 files changed, 6 insertions, 4 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 0438fb7229..803f1a615e 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -3431,7 +3431,8 @@ static int hc_usb_pd_control(struct host_cmd_handler_args *args)
r->state = pd[p->port].task_state;
args->response_size = sizeof(*r);
} else {
- r_v1->enabled = pd_comm_enabled;
+ r_v1->enabled = pd_comm_enabled |
+ (pd_is_connected(p->port) << 1);
r_v1->role = pd[p->port].power_role |
(pd[p->port].data_role << 1);
r_v1->polarity = pd[p->port].polarity;
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 8210dd858a..ef7836d40c 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -2885,7 +2885,7 @@ struct ec_response_usb_pd_control {
} __packed;
struct ec_response_usb_pd_control_v1 {
- uint8_t enabled;
+ uint8_t enabled; /* [0] comm enabled [1] connected */
uint8_t role; /* [0] power: 0=SNK/1=SRC [1] data: 0=UFP/1=DFP */
uint8_t polarity;
char state[32];
diff --git a/util/ectool.c b/util/ectool.c
index d7e3cf6907..b173d7ad19 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -3710,8 +3710,9 @@ int cmd_usb_pd(int argc, char *argv[])
r->role == PD_ROLE_SOURCE ? "SRC" : "SNK",
r->polarity + 1, r->state);
} else {
- printf("Port C%d is %s, Role:%s %s Polarity:CC%d State:%s\n",
- p.port, (r_v1->enabled) ? "enabled" : "disabled",
+ printf("Port C%d is %s,%s, Role:%s %s Polarity:CC%d State:%s\n",
+ p.port, (r_v1->enabled & 1) ? "enabled" : "disabled",
+ (r_v1->enabled & 2) ? "connected" : "disconnected",
r_v1->role & PD_ROLE_SOURCE ? "SRC" : "SNK",
r_v1->role & (PD_ROLE_DFP << 1) ? "DFP" : "UFP",
r_v1->polarity + 1, r_v1->state);