summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-06-12 15:21:08 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-13 02:53:36 +0000
commit46644763f0ee0aafd0367c17a19c17d2197a7841 (patch)
tree837b61420497c9e99877f42857f70cbaf317cc81
parentcb16cf9b65e37fe0554478e17a324c6e4e436875 (diff)
downloadchrome-ec-46644763f0ee0aafd0367c17a19c17d2197a7841.tar.gz
tcpc: disable TX timer as early as possible after DMA done
Move disabling the TX timer up to as soon as possible after DMA transmit is complete to avoid potentially clocking another bit, which could corrupt the end of the transaction. BUG=none BRANCH=smaug TEST=load on glados and use a scope to verify the end of transmit is clean. Change-Id: If52ba2475eeb9752da0acc8efc957c1f472bc711 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/277298 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/stm32/usb_pd_phy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/stm32/usb_pd_phy.c b/chip/stm32/usb_pd_phy.c
index eeb9b61e34..5c0ed3d0fd 100644
--- a/chip/stm32/usb_pd_phy.c
+++ b/chip/stm32/usb_pd_phy.c
@@ -295,12 +295,12 @@ static void tx_dma_done(void *data)
while (spi->sr & STM32_SPI_SR_BSY)
; /* wait for BSY == 0 */
- /* put TX pins and reference in Hi-Z */
- pd_tx_disable(port, polarity);
-
/* Stop counting */
pd_phy[port].tim_tx->cr1 &= ~1;
+ /* put TX pins and reference in Hi-Z */
+ pd_tx_disable(port, polarity);
+
#if defined(CONFIG_COMMON_RUNTIME) && defined(CONFIG_DMA_DEFAULT_HANDLERS)
task_set_event(PD_PORT_TO_TASK_ID(port), TASK_EVENT_DMA_TC, 0);
#endif