summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@google.com>2017-08-11 16:31:08 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-23 19:04:16 -0700
commit2668e5aeea93915c3720b7522e4a116cf6a20550 (patch)
tree4e26e6abddcb8e5431152ec32814aad75859f98b
parentaf85b4f30e41881e3e589931c250e13e045a47b1 (diff)
downloadchrome-ec-2668e5aeea93915c3720b7522e4a116cf6a20550.tar.gz
pd_control: make DISABLE port specific
this makes the PD_CONTROL_DISABLE subcommand of EC_CMD_PD_CONTROL port specific like all the other subcommands already are. the only place depthcharge uses PD_CONTROL_DISABLE is in anx7688.c and that code already passes the correct chip ID along, so this will not affect the current use case. ectool already does the right thing as well. TEST=used ectool to verify each port can be disabled independently. BRANCH=none BUG=b:64956885 Change-Id: I6514eb300793b8958ed78846298ec5b95f78e6dc Signed-off-by: Caveh Jalali <caveh@google.com> Reviewed-on: https://chromium-review.googlesource.com/616259 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--common/usb_pd_protocol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index a0dcff6e85..286a48aa87 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -3888,7 +3888,7 @@ DECLARE_HOST_COMMAND(EC_CMD_USB_PD_SET_AMODE,
static int pd_control(struct host_cmd_handler_args *args)
{
- static int pd_control_disabled;
+ static int pd_control_disabled[CONFIG_USB_PD_PORT_COUNT];
const struct ec_params_pd_control *cmd = args->params;
int enable = 0;
@@ -3897,11 +3897,11 @@ static int pd_control(struct host_cmd_handler_args *args)
/* Always allow disable command */
if (cmd->subcmd == PD_CONTROL_DISABLE) {
- pd_control_disabled = 1;
+ pd_control_disabled[cmd->chip] = 1;
return EC_RES_SUCCESS;
}
- if (pd_control_disabled)
+ if (pd_control_disabled[cmd->chip])
return EC_RES_ACCESS_DENIED;
if (cmd->subcmd == PD_SUSPEND) {