summaryrefslogtreecommitdiff
path: root/driver/charger/rt946x.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/charger/rt946x.c')
-rw-r--r--driver/charger/rt946x.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c
index 378d8f6814..7d724e68c2 100644
--- a/driver/charger/rt946x.c
+++ b/driver/charger/rt946x.c
@@ -399,10 +399,6 @@ static int rt946x_init_setting(void)
rv = rt946x_set_iprec(batt_info->precharge_current);
if (rv)
return rv;
- /* Enable charge current termination */
- rv = rt946x_set_bit(RT946X_REG_CHGCTRL2, RT946X_MASK_TE);
- if (rv)
- return rv;
return rt946x_init_irq();
}
@@ -903,3 +899,9 @@ int rt946x_cutoff_battery(void)
{
return rt946x_set_bit(RT946X_REG_CHGCTRL2, RT946X_MASK_SHIP_MODE);
}
+
+int rt946x_enable_charge_termination(int en)
+{
+ return (en ? rt946x_set_bit : rt946x_clr_bit)
+ (RT946X_REG_CHGCTRL2, RT946X_MASK_TE);
+}