summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-02-10 15:54:08 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-14 17:28:16 -0800
commit4d6eb1bc01ddbc87bbd53a317cfddd78f9cce1b2 (patch)
tree99e81ea0944118c6549a73551111fcf6dcae2b44 /common
parentc9ea4bddbc45ef9b0104d5afc8a1d2a811cad372 (diff)
downloadchrome-ec-4d6eb1bc01ddbc87bbd53a317cfddd78f9cce1b2.tar.gz
pdchipinfo: Add option to force renewal
This change adds an option to pdchipinfo command to force ec to get the version from the chip instead of the cache (if it's available). This option will be used after firmware update, which makes the cache value stale. BUG=chrome-os-partner:62383 BRANCH=none TEST=Run ectool as follows: localhost ~ # /tmp/ectool pdchipinfo 0 on vendor_id: 0xaaaa product_id: 0x3429 device_id: 0xad fw_version: 0x15 localhost ~ # /tmp/ectool pdchipinfo 1 on EC result 2 (ERROR) Change-Id: Icefe96d7fc1208b991a4caa13aaf4f04052edba7 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/441271 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usb_pd_protocol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 216886d0c7..51133b741b 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1648,7 +1648,7 @@ void pd_task(void)
#ifndef CONFIG_USB_PD_TCPC
if (!res) {
struct ec_response_pd_chip_info *info;
- tcpm_get_chip_info(port, &info);
+ tcpm_get_chip_info(port, 0, &info);
CPRINTS("TCPC p%d VID:0x%x PID:0x%x DID:0x%x FWV:0x%lx",
port, info->vendor_id, info->product_id,
info->device_id, info->fw_version_number);
@@ -3725,7 +3725,7 @@ static int hc_remote_pd_chip_info(struct host_cmd_handler_args *args)
if (p->port >= CONFIG_USB_PD_PORT_COUNT)
return EC_RES_INVALID_PARAM;
- if (tcpm_get_chip_info(p->port, &info))
+ if (tcpm_get_chip_info(p->port, p->renew, &info))
return EC_RES_ERROR;
memcpy(r, info, sizeof(*r));