diff options
-rw-r--r-- | driver/charger/isl923x.c | 8 | ||||
-rw-r--r-- | driver/charger/isl923x.h | 1 | ||||
-rw-r--r-- | include/driver/charger/isl923x_public.h | 9 |
3 files changed, 18 insertions, 0 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c index 129fe30000..09db9e0f2b 100644 --- a/driver/charger/isl923x.c +++ b/driver/charger/isl923x.c @@ -786,6 +786,14 @@ out: } #ifdef CONFIG_CHARGER_RAA489000 +int raa489000_enable_asgate(int chgnum, bool enable) +{ + enum mask_update_action action = enable ? MASK_SET : MASK_CLR; + + return raw_update16(chgnum, RAA489000_REG_CONTROL8, + RAA489000_C8_ASGATE_ON_READY, action); +} + void raa489000_hibernate(int chgnum, bool disable_adc) { int rv, regval; diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h index 69bc82389c..1ab0973b03 100644 --- a/driver/charger/isl923x.h +++ b/driver/charger/isl923x.h @@ -270,6 +270,7 @@ /* Control8: MCU_LDO - BAT state disable */ #define RAA489000_C8_MCU_LDO_BAT_STATE_DISABLE BIT(14) +#define RAA489000_C8_ASGATE_ON_READY BIT(13) /* OTG voltage limit in mV, current limit in mA */ #define ISL9237_OTG_VOLTAGE_MIN 4864 diff --git a/include/driver/charger/isl923x_public.h b/include/driver/charger/isl923x_public.h index df3b0ce057..d8cc9cf662 100644 --- a/include/driver/charger/isl923x_public.h +++ b/include/driver/charger/isl923x_public.h @@ -45,6 +45,15 @@ int isl923x_set_comparator_inversion(int chgnum, int invert); * @param chgnum index into chg_chips table. */ void raa489000_hibernate(int chgnum, bool disable_adc); + +/** + * Enable or Disable the ASGATE in the READY state. + * + * @param chgnum: Index into charger chips + * @param enable: whether to enable ASGATE + */ +int raa489000_enable_asgate(int chgnum, bool enable); + enum ec_error_list isl9238c_hibernate(int chgnum); enum ec_error_list isl9238c_resume(int chgnum); |