diff options
author | Caveh Jalali <caveh@google.com> | 2017-08-11 16:31:08 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-08-31 02:39:28 +0000 |
commit | 9f717dd86f4a77aaa9b03852e2179e6f9ce70af7 (patch) | |
tree | c8d95811f6de3285b824836ff1f0d7e8fe46cd76 | |
parent | 8d5206fc948209d09ca06127d657bf440088bfde (diff) | |
download | chrome-ec-9f717dd86f4a77aaa9b03852e2179e6f9ce70af7.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
Signed-off-by: Caveh Jalali <caveh@google.com>
Reviewed-on: https://chromium-review.googlesource.com/616259
Reviewed-by: Shawn N <shawnn@chromium.org>
(cherry picked from commit 2668e5aeea93915c3720b7522e4a116cf6a20550)
Change-Id: Ic08aef09d6426466d94558e9acc270b27c7a2067
Reviewed-on: https://chromium-review.googlesource.com/644852
Reviewed-by: Caveh Jalali <caveh@google.com>
Commit-Queue: Caveh Jalali <caveh@google.com>
Tested-by: Caveh Jalali <caveh@google.com>
-rw-r--r-- | common/usb_pd_protocol.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 9a095d5127..de7fb6806c 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -3847,7 +3847,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; @@ -3856,11 +3856,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) { |