diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c index 5dae530ef9..4924bc1f52 100644 --- a/driver/charger/isl923x.c +++ b/driver/charger/isl923x.c @@ -339,6 +339,24 @@ static void isl923x_init(void) goto init_fail; #endif /* defined(CONFIG_CHARGE_RAMP_HW) */ +#ifdef CONFIG_CHARGER_ISL9238 + /* + * Don't reread the prog pin and don't reload the ILIM on ACIN. + */ + if (raw_read16(ISL9238_REG_CONTROL3, ®)) + goto init_fail; + reg |= ISL9238_C3_NO_RELOAD_ACLIM_ON_ACIN | + ISL9238_C3_NO_REREAD_PROG_PIN; + if (raw_write16(ISL9238_REG_CONTROL3, reg)) + goto init_fail; + + /* + * Initialize the input current limit to the board's default. + */ + if (charger_set_input_current(CONFIG_CHARGER_INPUT_CURRENT)) + goto init_fail; +#endif /* defined(CONFIG_CHARGER_ISL9238) */ + return; init_fail: CPRINTF("isl923x_init failed!"); diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h index fc89e2dec7..361bf0272d 100644 --- a/driver/charger/isl923x.h +++ b/driver/charger/isl923x.h @@ -210,6 +210,12 @@ /* Control3: PSYS gain in uA/W (ISL9238 only) */ #define ISL9238_C3_PSYS_GAIN (1 << 9) +/* Control3: Don't reload ACLIM on ACIN. */ +#define ISL9238_C3_NO_RELOAD_ACLIM_ON_ACIN (1 << 14) + +/* Control3: Don't reread PROG pin. */ +#define ISL9238_C3_NO_REREAD_PROG_PIN (1 << 15) + /* OTG voltage limit in mV, current limit in mA */ #define ISL9237_OTG_VOLTAGE_MIN 4864 #define ISL9237_OTG_VOLTAGE_MAX 5376