diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2017-01-25 18:39:39 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-09 22:50:50 -0800 |
commit | 4ff544a573302336b1e2d8b55bfa8a32f847de4e (patch) | |
tree | 1951ca71b4247a18d3f306dcd37879f6bd8a2c4b /include/usb_pd_tcpm.h | |
parent | b889e47410698986822712078ec232c1715b4845 (diff) | |
download | chrome-ec-4ff544a573302336b1e2d8b55bfa8a32f847de4e.tar.gz |
Add host command to get PD chip information
This patch adds a host command to get PD chip info.
For PS8751, tcpci_get_chip_info will fail if the chip is in
low power mode. It can be woken up by reading a random register
first then wait for 10ms.
This code doesn't have the wake-up read to avoid 10ms delay.
Instead, we call this function immediately after the chip is
initialized because it'll gurantee the chip is awake.
Once it's called, the chip info will be stored in cache, which
can be accessed by tcpc_get_chip_info without worrying about
chip states.
localhost ~ # ectool pdchipinfo 0
vendor_id: 0xaaaa
product_id: 0x3429
device_id: 0xad
fw_version: 0x15
localhost ~ # ectool pdchipinfo 1
vendor_id: 0x1da0
product_id: 0x8751
device_id: 0x1
fw_version: 0x37
BUG=chrome-os-partner:62383
BRANCH=none
TEST=ectool pdchipinfo 0/1. make buildall
Change-Id: I3f1667d00ce1826936d90882ada1df6ed6b0ea37
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/433166
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r-- | include/usb_pd_tcpm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index 5960d1b62e..d95d994184 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -8,6 +8,8 @@ #ifndef __CROS_EC_USB_PD_TCPM_H #define __CROS_EC_USB_PD_TCPM_H +#include "ec_commands.h" + /* Default retry count for transmitting */ #define PD_RETRY_COUNT 3 @@ -195,6 +197,16 @@ struct tcpm_drv { */ int (*drp_toggle)(int port); #endif + + /** + * Get firmware version. + * + * @param port Type-C port number + * @param info Pointer to pointer to PD chip info + * + * @return EC_SUCCESS or error + */ + int (*get_chip_info)(int port, struct ec_response_pd_chip_info **info); }; enum tcpc_alert_polarity { |