From 066bb6149d1440efe688d548dbc6bec539a39222 Mon Sep 17 00:00:00 2001 From: Rong Chang Date: Tue, 31 May 2016 14:04:38 +0800 Subject: [PATCH] tcpci: anx7688: enable message passing after hard reset sent In TCPCI specifiction R1.0 4.7.2, the last step of transmitting hard reset message is enable PD message passing by writing to RECEIVE_MESSAGE register. BRANCH=none BUG=chrome-os-partner:52815 TEST=manual build and load on reference board with anx7688 port controller. connect zinger to port 0, and use ec uart console to send hard reset message: pd 0 hard check PD communication Signed-off-by: Rong Chang Change-Id: I52968b603f0227d7d9a112b0216cd5fd6362a0b2 Reviewed-on: https://chromium-review.googlesource.com/348142 Commit-Ready: Nicolas Boichat Tested-by: Koro Chen Reviewed-by: Wei-Ning Huang Reviewed-by: Vincent Palatin --- common/usb_pd_protocol.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 84186ed754..75c38b1d08 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -2135,6 +2135,16 @@ void pd_task(void) } if (pd_is_vbus_present(port) && snk_hard_reset_vbus_off) { +#ifdef CONFIG_USB_PD_TCPM_TCPCI + /* + * After transmitting hard reset, TCPM writes + * to RECEIVE_MESSAGE register to enable + * PD message passing. + */ + if (pd_comm_enabled) + tcpm_set_rx_enable(port, 1); +#endif /* CONFIG_USB_PD_TCPM_TCPCI */ + /* VBUS went high again */ set_state(port, PD_STATE_SNK_DISCOVERY); timeout = 10*MSEC;