summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2023-05-08 17:48:12 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-11 07:46:47 +0000
commit0d6fd0109cc767c69aecff8617a58190685d3b5b (patch)
tree427a28057a820db96fa74c5b1973fb9af638bcd6
parent4ce5adab50925dab5384ee861ae9732062f427f0 (diff)
downloadchrome-ec-0d6fd0109cc767c69aecff8617a58190685d3b5b.tar.gz
rt1718s: do not software reset TCPC with battery
The RT1718S controls the EN_SNK pin to the PPC. When the TCPC is reset without battery connected, this might cause the brown-out of the system due to the PPC stops sinking. BUG=b:276661970 TEST=reset EC without battery, and it first boots due to the soft-reset, and brown-out and then second boots with power-on flag. BRANCH=none Change-Id: Icc9696a5085ab502a451a9740271e16e06bd53b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4506108 Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Sung-Chi Li <lschyi@chromium.org>
-rw-r--r--driver/tcpm/rt1718s.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/driver/tcpm/rt1718s.c b/driver/tcpm/rt1718s.c
index 3d4303a8b7..e8ee85368a 100644
--- a/driver/tcpm/rt1718s.c
+++ b/driver/tcpm/rt1718s.c
@@ -7,6 +7,7 @@
* RT1718S TCPC Driver
*/
+#include "battery.h"
#include "console.h"
#include "driver/tcpm/rt1718s.h"
#include "driver/tcpm/tcpci.h"
@@ -261,6 +262,11 @@ static int rt1718s_init(int port)
{
static bool need_sw_reset = true;
+ /* Do not reset the TCPC when device is no battery connected, otherwise
+ * the SINK GPIO to the PPC may be reset, and cause a brown-out.
+ */
+ need_sw_reset &= battery_is_present() == BP_YES;
+
if (!system_jumped_late() && need_sw_reset) {
RETURN_ERROR(rt1718s_sw_reset(port));
need_sw_reset = false;