diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2017-04-26 17:20:27 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-01 21:54:05 -0700 |
commit | a97dae473824950a33e8cbf930e3a5c6c04108f4 (patch) | |
tree | 39f12b5d4a08375170ff59615e962aa8c5f0569b | |
parent | f1e98218776de9380141384af4ffc9611f6f4adc (diff) | |
download | chrome-ec-a97dae473824950a33e8cbf930e3a5c6c04108f4.tar.gz |
tcpm: it83xx: added chip info
We can get the correct chip info after the change was made.
BRANCH=none
BUG=none
TEST=console message:
[0.013915 TCPC p1 VID:0x48d PID:0x8320 DID:0x1 FWV:0xec]
[0.018054 TCPC p0 VID:0x48d PID:0x8320 DID:0x1 FWV:0xec]
Change-Id: I4eb94967acb351559e745ed1c4e34a4c58f41e14
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/487767
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | chip/it83xx/registers.h | 2 | ||||
-rw-r--r-- | driver/tcpm/it83xx.c | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/chip/it83xx/registers.h b/chip/it83xx/registers.h index 4d5aec7131..a68cd1fe0b 100644 --- a/chip/it83xx/registers.h +++ b/chip/it83xx/registers.h @@ -1231,6 +1231,8 @@ enum usbpd_port { USBPD_PORT_COUNT, }; +#define USB_VID_ITE 0x048d + /* Wake pin definitions, defined at board-level */ extern const enum gpio_signal hibernate_wake_pins[]; extern const int hibernate_wake_pins_used; diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c index ed6fcc141b..fc93cf47a2 100644 --- a/driver/tcpm/it83xx.c +++ b/driver/tcpm/it83xx.c @@ -486,6 +486,20 @@ static int it83xx_tcpm_transmit(int port, return EC_SUCCESS; } +static int it83xx_tcpm_get_chip_info(int port, int renew, + struct ec_response_pd_chip_info **chip_info) +{ + static struct ec_response_pd_chip_info i; + + *chip_info = &i; + i.vendor_id = USB_VID_ITE; + i.product_id = (IT83XX_GCTRL_CHIPID1 << 8) | IT83XX_GCTRL_CHIPID2; + i.device_id = IT83XX_GCTRL_CHIPVER & 0xf; + i.fw_version_number = 0xEC; + + return EC_SUCCESS; +} + const struct tcpm_drv it83xx_tcpm_drv = { .init = &it83xx_tcpm_init, .get_cc = &it83xx_tcpm_get_cc, @@ -507,5 +521,5 @@ const struct tcpm_drv it83xx_tcpm_drv = { #ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE .drp_toggle = NULL, #endif - .get_chip_info = NULL, + .get_chip_info = &it83xx_tcpm_get_chip_info, }; |