summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnwc_yeh <johnwc_yeh@compal.corp-partner.google.com>2022-12-09 10:47:17 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-20 03:14:12 +0000
commitaeb757fd759b4fd649e5758a6ebc18117a3aefc9 (patch)
treeaa63eabf76cfacda0998b4900febf107fd04979e
parent91e88efa00a878356f1e708b50a99bc3339b7c62 (diff)
downloadchrome-ec-aeb757fd759b4fd649e5758a6ebc18117a3aefc9.tar.gz
charger/isl9238c: enable force buck mode
Enable force buck mode for isl9238c. LOW_COVERAGE_REASON=No isl9238c emulator BUG=b:257851736 BRANCH=none TEST=check ISL9238C control0 bit1 can set Change-Id: I9be2c2ad5f0c42797548c2e99b231244de30c51c Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4091087 Code-Coverage: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--driver/charger/isl923x.c10
-rw-r--r--driver/charger/isl923x.h1
-rw-r--r--include/config.h5
-rw-r--r--zephyr/Kconfig.charger8
-rw-r--r--zephyr/shim/include/config_chip.h5
5 files changed, 29 insertions, 0 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c
index dac1df69a2..d67c769219 100644
--- a/driver/charger/isl923x.c
+++ b/driver/charger/isl923x.c
@@ -705,6 +705,16 @@ static void isl923x_init(int chgnum)
if (raw_write16(chgnum, ISL9238C_REG_CONTROL6, reg))
goto init_fail;
+
+ if (IS_ENABLED(CONFIG_ISL9238C_ENABLE_BUCK_MODE)) {
+ if (raw_read16(chgnum, ISL923X_REG_CONTROL0, &reg))
+ goto init_fail;
+
+ reg |= ISL923X_C0_ENABLE_BUCK;
+
+ if (raw_write16(chgnum, ISL923X_REG_CONTROL0, reg))
+ goto init_fail;
+ }
}
if (IS_ENABLED(CONFIG_CHARGER_RAA489000)) {
diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h
index e25dd263e6..ad998554b1 100644
--- a/driver/charger/isl923x.h
+++ b/driver/charger/isl923x.h
@@ -97,6 +97,7 @@
#define ISL9237_C0_VREG_REF_MASK 0x03
/* Control0: disable adapter voltaqe regulation */
+#define ISL923X_C0_ENABLE_BUCK BIT(1)
#define ISL923X_C0_DISABLE_VREG BIT(2)
/* Control0: battery DCHOT reference for RS2 == 20mOhm */
diff --git a/include/config.h b/include/config.h
index f353ef0d73..47bb43a83b 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3487,6 +3487,11 @@
*/
#undef CONFIG_ISL9238C_DISABLE_CMOUT_LATCH
+/*
+ * ISL9238C enable Force Buck mode.
+ */
+#undef CONFIG_ISL9238C_ENABLE_BUCK_MODE
+
/* Support MKBP event */
#undef CONFIG_MKBP_EVENT
diff --git a/zephyr/Kconfig.charger b/zephyr/Kconfig.charger
index ee47a06040..30fdb98cde 100644
--- a/zephyr/Kconfig.charger
+++ b/zephyr/Kconfig.charger
@@ -766,6 +766,14 @@ config PLATFORM_EC_ISL9238C_DISABLE_CMOUT_LATCH
help
Disable the CMOUT latch function for ISL9238C.
+config PLATFORM_EC_ISL9238C_ENABLE_BUCK_MODE
+ bool "Enable Force Buck mode"
+ default n
+ depends on PLATFORM_EC_CHARGER_ISL9238C
+ help
+ Enable Force Buck mode for ISL9238C.
+ If the Force Buck mode is enabled, the Buck-Boost window narrows.
+
config PLATFORM_EC_AC_PROCHOT_CURRENT_MA
int "Value of the prochot threshold current in mA"
default 3328
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index e9fd8727f0..08bf6ddb0f 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -362,6 +362,11 @@
#define CONFIG_ISL9238C_DISABLE_CMOUT_LATCH
#endif
+#undef CONFIG_ISL9238C_ENABLE_BUCK_MODE
+#ifdef CONFIG_PLATFORM_EC_ISL9238C_ENABLE_BUCK_MODE
+#define CONFIG_ISL9238C_ENABLE_BUCK_MODE
+#endif
+
#undef CONFIG_AC_PROCHOT_CURRENT_MA
#ifdef CONFIG_PLATFORM_EC_AC_PROCHOT_CURRENT_MA
#define CONFIG_AC_PROCHOT_CURRENT_MA CONFIG_PLATFORM_EC_AC_PROCHOT_CURRENT_MA