diff options
-rw-r--r-- | driver/charger/isl923x.c | 10 | ||||
-rw-r--r-- | driver/charger/isl923x.h | 1 | ||||
-rw-r--r-- | include/config.h | 5 | ||||
-rw-r--r-- | zephyr/Kconfig.charger | 8 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
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, ®)) + 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 |