summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McRae <amcrae@google.com>2020-05-19 14:35:31 +1000
committerCommit Bot <commit-bot@chromium.org>2020-05-28 02:50:48 +0000
commitf73bd4dd7285bea816af0c2f35059bb441fc4037 (patch)
treeb25ee4e8cf06bff647b7050b0e0bf40e03cfc960
parent357925c4e02cea8c102a3996e79e25e358f9e109 (diff)
downloadchrome-ec-f73bd4dd7285bea816af0c2f35059bb441fc4037.tar.gz
Puff: Clear the PD saved state if TCPC is reset
After a reset of the TCPC, clear the saved PD state from BBRAM. BUG=b:155145509 TEST=Build and boot puff. BRANCH=none Change-Id: I4e7af5ecb9b12d9b1fd93a7a2c72be91789f0c85 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2206524 Tested-by: Andrew McRae <amcrae@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org>
-rw-r--r--board/puff/board.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/puff/board.c b/board/puff/board.c
index ee98556e3a..d0415f7b62 100644
--- a/board/puff/board.c
+++ b/board/puff/board.c
@@ -41,6 +41,7 @@
#include "thermistor.h"
#include "uart.h"
#include "usb_charge.h"
+#include "usb_common.h"
#include "usb_pd.h"
#include "usbc_ppc.h"
#include "util.h"
@@ -508,6 +509,9 @@ void board_reset_pd_mcu(void)
gpio_set_level(GPIO_USB_C0_TCPC_RST, !level);
if (BOARD_TCPC_C0_RESET_POST_DELAY)
msleep(BOARD_TCPC_C0_RESET_POST_DELAY);
+ /* Reset any saved state for previous connections. */
+ pd_update_saved_port_flags(USB_PD_PORT_TCPC_0,
+ PD_BBRMFLG_EXPLICIT_CONTRACT, 0);
}
int board_set_active_charge_port(int port)