File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -827,15 +827,20 @@ void charger_update(void)
827827{
828828 static int pre_ac_state ;
829829 static int pre_dc_state ;
830- uint16_t val = 0x0000 ;
830+ int val = 0x0000 ;
831831
832832 if (pre_ac_state != extpower_is_present () ||
833833 pre_dc_state != battery_is_present ())
834834 {
835835 CPRINTS ("update charger!!" );
836836
837- val = ISL9241_CONTROL1_PROCHOT_REF_6800 |
838- ISL9241_CONTROL1_SWITCH_FREQ ;
837+ if (i2c_read16 (I2C_PORT_CHARGER , ISL9241_ADDR_FLAGS ,
838+ ISL9241_REG_CONTROL1 , & val )) {
839+ CPRINTS ("read charger control1 fail" );
840+ }
841+
842+ val |= (ISL9241_CONTROL1_PROCHOT_REF_6800 |
843+ ISL9241_CONTROL1_SWITCH_FREQ );
839844
840845 if (i2c_write16 (I2C_PORT_CHARGER , ISL9241_ADDR_FLAGS ,
841846 ISL9241_REG_CONTROL1 , val )) {
You can’t perform that action at this time.
0 commit comments