summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2018-06-18 13:15:43 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-06-19 19:11:09 -0700
commit4a9b039e47ddda25bc02232d7e8314a72cdc2c7b (patch)
tree9976d8dec1bfd17ce05398e33700e69a6414b80d
parent8400787279345a1810b2635ba0bab4ae3bd5e537 (diff)
downloadchrome-ec-4a9b039e47ddda25bc02232d7e8314a72cdc2c7b.tar.gz
ppc: sn5s330: Set VCONN ILIM to 0.6A (min).
It seems that several charge through hubs have inrush currents that exceed 350mA when VCONN is applied. This in turn causes the SN5S330 to latch off VCONN due to the overcurrent condition. This commit simply sets the VCONN current limit to the 600mA (min) setting. BUG=b:110370179 BRANCH=None TEST=Flash nocturne; Use a variety of charge through hubs, verify that VCONN is not latched off. Change-Id: I7a0e5d1aa7c42d22b43a596520790debee47163b Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1105309 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--driver/ppc/sn5s330.c10
-rw-r--r--driver/ppc/sn5s330.h1
2 files changed, 7 insertions, 4 deletions
diff --git a/driver/ppc/sn5s330.c b/driver/ppc/sn5s330.c
index 07ff202436..b5807e4f0d 100644
--- a/driver/ppc/sn5s330.c
+++ b/driver/ppc/sn5s330.c
@@ -244,8 +244,6 @@ static int sn5s330_init(int port)
return status;
}
- /* TODO(aaboagye): What about Vconn? */
-
/*
* Indicate we are using PP2 configuration 2 and enable OVP comparator
* for CC lines.
@@ -274,13 +272,17 @@ static int sn5s330_init(int port)
return status;
}
- /* Turn off dead battery resistors and turn on CC FETs. */
+ /*
+ * Turn off dead battery resistors, turn on CC FETs, and set the higher
+ * of the two VCONN current limits (min 0.6A). Many VCONN accessories
+ * trip the default current limit of min 0.35A.
+ */
status = i2c_read8(i2c_port, i2c_addr, SN5S330_FUNC_SET4, &regval);
if (status) {
CPRINTS("ppc p%d: Failed to read FUNC_SET4!", port);
return status;
}
- regval |= SN5S330_CC_EN;
+ regval |= SN5S330_CC_EN | SN5S330_VCONN_ILIM_SEL;
status = i2c_write8(i2c_port, i2c_addr, SN5S330_FUNC_SET4, regval);
if (status) {
CPRINTS("ppc p%d: Failed to set FUNC_SET4!", port);
diff --git a/driver/ppc/sn5s330.h b/driver/ppc/sn5s330.h
index 7d3ba6103e..2b17a1d46a 100644
--- a/driver/ppc/sn5s330.h
+++ b/driver/ppc/sn5s330.h
@@ -99,6 +99,7 @@ enum sn5s330_pp_idx {
#define SN5S330_VCONN_EN (1 << 0)
#define SN5S330_CC_POLARITY (1 << 1)
#define SN5S330_CC_EN (1 << 4)
+#define SN5S330_VCONN_ILIM_SEL (1 << 5)
/* FUNC_SET_9 */
#define SN5S330_PP2_CONFIG (1 << 2)