Skip to content

Commit 876634f

Browse files
committed
Azalea: update the charger register 0x3c before register 0x40
Signed-off-by: Josh-Tsai <josh_tsai@compal.com>
1 parent d8c12a6 commit 876634f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

zephyr/program/lotus/azalea/src/charger.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static void charger_chips_init(void)
3535
* after ADC
3636
*/
3737

38-
const int no_battery_current_limit_override_ma = 6000;
38+
const int no_battery_current_limit_override_ma = 3000;
3939
const struct battery_info *bi = battery_get_info();
4040
uint16_t val = 0x0000; /*default ac setting */
4141
uint32_t data = 0;
@@ -59,6 +59,14 @@ static void charger_chips_init(void)
5959
ISL9241_CONTROL4_ACOK_BATGONE_DEBOUNCE_25US))
6060
goto init_fail;
6161

62+
/*
63+
* Set control3 register to
64+
* [14]: ACLIM Reload (Do not reload)
65+
*/
66+
if (i2c_write16(I2C_PORT_CHARGER, ISL9241_ADDR_FLAGS,
67+
ISL9241_REG_CONTROL3, ISL9241_CONTROL3_ACLIM_RELOAD))
68+
goto init_fail;
69+
6270
value = battery_is_charge_fet_disabled();
6371
/* reverse the flag if no error */
6472
if (value != -1)
@@ -103,14 +111,6 @@ static void charger_chips_init(void)
103111
ISL9241_CONTROL2_PROCHOT_DEBOUNCE_1000))
104112
goto init_fail;
105113

106-
/*
107-
* Set control3 register to
108-
* [14]: ACLIM Reload (Do not reload)
109-
*/
110-
if (i2c_write16(I2C_PORT_CHARGER, ISL9241_ADDR_FLAGS,
111-
ISL9241_REG_CONTROL3, ISL9241_CONTROL3_ACLIM_RELOAD))
112-
goto init_fail;
113-
114114
if (i2c_write16(I2C_PORT_CHARGER, ISL9241_ADDR_FLAGS,
115115
ISL9241_REG_CONTROL0, 0x0000))
116116
goto init_fail;

0 commit comments

Comments
 (0)