Skip to content

Commit fc0bf7d

Browse files
authored
Merge pull request #444 from FrameworkComputer/hx20_PSYS
[fix] fix psys not enable in S0 mode
2 parents 6a7280d + 1030bf6 commit fc0bf7d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

board/hx20/board.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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)) {

0 commit comments

Comments
 (0)