summaryrefslogtreecommitdiff
path: root/driver/charger
diff options
context:
space:
mode:
authorjohnwc_yeh <johnwc_yeh@compal.corp-partner.google.com>2023-01-19 11:25:17 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-30 02:25:55 +0000
commitc9f629f5473363d01e8afd5d4825a9b27e961ae0 (patch)
treef17476aaeda1e7c3c265ff3f2c8bd96d18e23e06 /driver/charger
parent221c98d97cbb199b4865ae7339ff80b7c8aae8fb (diff)
downloadchrome-ec-c9f629f5473363d01e8afd5d4825a9b27e961ae0.tar.gz
charger/isl9238c: Add BUCK_PHASE_VOLTAGE config
Adjusts the phase comparator threshold offset for forward buck and buck-boost. LOW_COVERAGE_REASON=No isl9238c emulator BUG=b:265862821 BRANCH=none TEST=fix charger stuck in CCM problem and S5 power consumption can meet < 0.5W criteria. Change-Id: Idc10c266e97c104f221eabc51b28c6c243ce17be Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179434 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver/charger')
-rw-r--r--driver/charger/isl923x.c4
-rw-r--r--driver/charger/isl923x.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c
index e2838810f1..24e9e488a5 100644
--- a/driver/charger/isl923x.c
+++ b/driver/charger/isl923x.c
@@ -711,6 +711,10 @@ static void isl923x_init(int chgnum)
goto init_fail;
reg |= ISL923X_C0_ENABLE_BUCK;
+ /* Adjusts phase comparator threshold offset */
+ reg &= ~ISL923X_C0_BUCK_PHASE_MASK;
+ reg |= CONFIG_ISL9238C_BUCK_PHASE_VOLTAGE
+ << ISL923X_C0_BUCK_PHASE_SHIFT;
if (raw_write16(chgnum, ISL923X_REG_CONTROL0, reg))
goto init_fail;
diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h
index cec8f43fd3..251d62dc99 100644
--- a/driver/charger/isl923x.h
+++ b/driver/charger/isl923x.h
@@ -107,6 +107,10 @@
#define ISL923X_C0_DCHOT_3A (3 << 3)
#define ISL923X_C0_DCHOT_MASK (3 << 3)
+/* Control0: adjusts phase comparator threshold offset for forward buck */
+#define ISL923X_C0_BUCK_PHASE_MASK GENMASK(15, 13)
+#define ISL923X_C0_BUCK_PHASE_SHIFT 13
+
/* Control0: BGATE force on */
#define RAA489000_C0_BGATE_FORCE_ON BIT(10)
#define RAA489000_C0_EN_CHG_PUMPS_TO_100PCT BIT(6)