From 077c1d050ac6fc234427c6e7552ae4f4b9bc2fb2 Mon Sep 17 00:00:00 2001 From: "[A" Date: Fri, 18 Nov 2022 15:50:42 +0800 Subject: [PATCH] optimize IR comp for 2nd chg ic Details: optimize IR comp for 2nd chg ic Change-Id: I1d1fde7b7e10ac3ba5a8bab67cd827a8b36c961b Reviewed-on: https://gerrit.mot.com/2433431 Reviewed-by: SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Lei Chen Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- drivers/power/bq2589x_chg_mmi/bq2589x_charger.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/power/bq2589x_chg_mmi/bq2589x_charger.c b/drivers/power/bq2589x_chg_mmi/bq2589x_charger.c index 6522edefb9cf..4abb33b417c2 100644 --- a/drivers/power/bq2589x_chg_mmi/bq2589x_charger.c +++ b/drivers/power/bq2589x_chg_mmi/bq2589x_charger.c @@ -2558,7 +2558,7 @@ static void bq2589x_adjust_constant_voltage(struct bq2589x *bq, int vbat) int cv_adjust; u8 status = 0; - dev_err(bq->dev, "bq2589x_adjust_constant_voltage 111\n"); + dev_err(bq->dev, "bq2589x_adjust_constant_voltage\n"); if (bq->final_cv > vbat && (bq->final_cv - vbat) < 16000) return; @@ -2730,6 +2730,12 @@ static void bq2589x_charger_irq_workfunc(struct work_struct *work) ret = bq2589x_set_input_volt_limit(bq, bq->cfg.vindpm); bq->vindpm_flag = false; } + /* enable dynamic adjust battery voltage */ + if(bq->enable_dynamic_adjust_batvol){ + bq->cv_tune = 0; + bq->final_cv /= 1000; + bq2589x_set_chargevoltage(bq, bq->final_cv); + } } else if ((bq->vbus_type != BQ2589X_VBUS_NONE) && (bq->vbus_type != BQ2589X_VBUS_OTG) && (!(bq->status & BQ2589X_STATUS_PLUGIN) || (reapsd_complete == true)) && state.online) {