diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-11-17 11:48:26 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-17 22:06:49 -0800 |
commit | f0489dc275f8782365b89cdd9db956e7b78018be (patch) | |
tree | d253dcc38e56b6ca5b2c5f572f81cfd8bf66ec3b | |
parent | 4b10eb6c09efd133f6ba2fcce6463cf8e925495c (diff) | |
download | chrome-ec-f0489dc275f8782365b89cdd9db956e7b78018be.tar.gz |
pd: initialize tcpc when tcpm boots
Always initialize TCPC when TCPM boots. This guarantees
that our TCPM driver is synced up with the TCPC reg values.
BUG=chrome-os-partner:47608
BRANCH=none
TEST=test on glados. reboot EC and PD MCUs independently
with and without external power.
Change-Id: I2d989e8a85ba8a72fe1a8edaef8da9c51651d240
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312951
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | common/usb_pd_protocol.c | 2 | ||||
-rw-r--r-- | driver/tcpm/fusb302.c | 9 |
2 files changed, 0 insertions, 11 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index e97380dc3c..511c5aba4c 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1397,11 +1397,9 @@ void pd_task(void) pd[port].flags = pd_is_vbus_present(port) ? PD_FLAGS_VBUS_NEVER_LOW : 0; #endif -#ifdef CONFIG_USB_PD_TCPC /* Initialize TCPM driver and wait for TCPC to be ready */ tcpm_init(port); CPRINTF("[%T TCPC p%d ready]\n", port); -#endif /* Disable TCPC RX until connection is established */ tcpm_set_rx_enable(port, 0); diff --git a/driver/tcpm/fusb302.c b/driver/tcpm/fusb302.c index 2bddaff7fb..a14cd92eb4 100644 --- a/driver/tcpm/fusb302.c +++ b/driver/tcpm/fusb302.c @@ -326,15 +326,6 @@ static int fusb302_send_message(int port, uint16_t header, const uint32_t *data, return rv; } -void tcpm_init_ports(void) -{ - int i; - - for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; i++) - tcpm_init(i); -} -DECLARE_HOOK(HOOK_INIT, tcpm_init_ports, HOOK_PRIO_DEFAULT); - int tcpm_init(int port) { int reg; |