diff options
author | Jett Rink <jettrink@chromium.org> | 2018-12-17 09:35:24 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-18 21:33:19 -0800 |
commit | eec37303264a1bb90a7cfc4ba97b40f55da6e87e (patch) | |
tree | 98ec496354f06a4aa5a8fa621f93cb764f0ab813 /driver | |
parent | 4dd9607ff06416f09b5d91dc531a23c9c54d14ec (diff) | |
download | chrome-ec-eec37303264a1bb90a7cfc4ba97b40f55da6e87e.tar.gz |
tcpc: remove reset check in alert handler
If the image supports TCPC low power mode, then we already
initialized the devices after exiting low power mode. No need
to check again.
BRANCH=none
BUG=chromium:875274
TEST=On an octopus board, PS8751 and ANX3447 work with TCPC smoke test
of plugging/unplugging
Change-Id: I54e9038db87f9cf998431263df0cf8fa254bde83
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1379705
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/tcpm/tcpci.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c index e3c266a478..60cfa33760 100644 --- a/driver/tcpm/tcpci.c +++ b/driver/tcpm/tcpci.c @@ -478,7 +478,12 @@ int tcpci_tcpm_transmit(int port, enum tcpm_transmit_type type, return rv; } -/* Returns true if TCPC has reset based on reading mask registers. */ +#ifndef CONFIG_USB_PD_TCPC_LOW_POWER +/* + * Returns true if TCPC has reset based on reading mask registers. Only need to + * check this if the TCPC low power mode (LPM) code isn't compiled in because + * LPM will automatically reset the device when the TCPC exits LPM. + */ static int register_mask_reset(int port) { int mask; @@ -495,6 +500,7 @@ static int register_mask_reset(int port) return 0; } +#endif /* * Don't let the TCPC try to pull from the RX buffer forever. We typical only @@ -571,14 +577,16 @@ void tcpci_tcpc_alert(int port) pd_event |= TASK_EVENT_WAKE; } +#ifndef CONFIG_USB_PD_TCPC_LOW_POWER /* - * TODO(crbug.com/875274): Remove this check - * * Check registers to see if we can tell that the TCPC has reset. If - * so, perform a tcpc_init. + * so, perform a tcpc_init. This only needs to happen for devices that + * don't support low power mode as the transition from low power mode + * will automatically reset the device. */ if (register_mask_reset(port)) pd_event |= PD_EVENT_TCPC_RESET; +#endif /* * Wait until all possible TCPC accesses in this function are complete |