summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyushee Shah <ayushee.shah@intel.com>2021-01-26 15:19:44 -0800
committerCommit Bot <commit-bot@chromium.org>2021-02-09 17:17:37 +0000
commitdb668550b8d4404ed84f752d6d915b41e21984f5 (patch)
tree8539195892b28f3c4d29e1c6b7ad16f4cf008573
parentec4570b402232b29ff080257d6246e19bb57d5db (diff)
downloadchrome-ec-db668550b8d4404ed84f752d6d915b41e21984f5.tar.gz
usb_pd: Update setting enable bit in hc_usb_pd_control()
Set the enable patch according to pd_comm_is_enabled(), pd_is_connected() and pd_capable() irrespective of status of disconnect_latch flag BUG=b:173459141 BRANCH=None TEST=Able to enter AP driven alternate mode Cq-Depend: chromium:2639103 Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: I9b54d2f24df55fec3970693007fefc3563921759 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2649154 Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2684757 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Tested-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usb_pd_host_cmd.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c
index 7cb620c7ed..c08332621b 100644
--- a/common/usb_pd_host_cmd.c
+++ b/common/usb_pd_host_cmd.c
@@ -351,22 +351,13 @@ static enum ec_status hc_usb_pd_control(struct host_cmd_handler_args *args)
break;
case 1:
case 2:
- /*
- * Set enabled to 0 if disconnect latch flag=true, needed this
- * to configure Virtual mux in disconnect mode.
- */
- if (IS_ENABLED(CONFIG_USB_MUX_VIRTUAL) &&
- usb_mux_get_disconnect_latch_flag(p->port)) {
- r_v2->enabled = 0;
- } else {
- r_v2->enabled =
- (pd_comm_is_enabled(p->port) ?
- PD_CTRL_RESP_ENABLED_COMMS : 0) |
- (pd_is_connected(p->port) ?
- PD_CTRL_RESP_ENABLED_CONNECTED : 0) |
- (pd_capable(p->port) ?
- PD_CTRL_RESP_ENABLED_PD_CAPABLE : 0);
- }
+ r_v2->enabled =
+ (pd_comm_is_enabled(p->port) ?
+ PD_CTRL_RESP_ENABLED_COMMS : 0) |
+ (pd_is_connected(p->port) ?
+ PD_CTRL_RESP_ENABLED_CONNECTED : 0) |
+ (pd_capable(p->port) ?
+ PD_CTRL_RESP_ENABLED_PD_CAPABLE : 0);
r_v2->role = pd_get_role_flags(p->port);
r_v2->polarity = pd_get_polarity(p->port);