bq25890: set input voltage limit 4600mv

As bq2589x_adjust_absolute_vindpm api sleep 1s to get vbus
voltage, but it will cause charger type update to charging policy
slowly. So directly call bq2589x_set_input_volt_limit api.

Change-Id: I4890f8b1aad066ceb8fe5b3655ac77a4620b7f87
Signed-off-by: mahj8 <mahj8@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2097216
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
mahj8 2021-10-22 18:09:39 +08:00 • committed by Haijian Ma
commit ec1c78a8a6

View file

@ -1414,6 +1414,7 @@ static void bq2589x_adjust_absolute_vindpm(struct bq2589x *bq)
static void bq2589x_adapter_in_func(struct bq2589x *bq)
{
int ret = 0;
if ((bq->vbus_type == BQ2589X_VBUS_USB_SDP ||
bq->vbus_type == BQ2589X_VBUS_NONSTAND ||
@ -1457,8 +1458,13 @@ static void bq2589x_adapter_in_func(struct bq2589x *bq)
break;
}
if (bq->cfg.use_absolute_vindpm)
bq2589x_adjust_absolute_vindpm(bq);
if (bq->cfg.use_absolute_vindpm) {
ret = bq2589x_set_input_volt_limit(bq, 4600);
if (ret < 0)
dev_err(bq->dev,"%s:reset vindpm threshold to 4600 failed:%d\n",__func__,ret);
else
dev_info(bq->dev,"%s:reset vindpm threshold to 4600 successfully\n",__func__);
}
if (pe.enable) {
schedule_delayed_work(&bq->monitor_work, 0);
@ -1474,11 +1480,11 @@ static void bq2589x_adapter_out_func(struct bq2589x *bq)
{
int ret;
ret = bq2589x_set_input_volt_limit(bq, 4400);
ret = bq2589x_set_input_volt_limit(bq, 4600);
if (ret < 0)
dev_err(bq->dev,"%s:reset vindpm threshold to 4400 failed:%d\n",__func__,ret);
dev_err(bq->dev,"%s:reset vindpm threshold to 4600 failed:%d\n",__func__,ret);
else
dev_info(bq->dev,"%s:reset vindpm threshold to 4400 successfully\n",__func__);
dev_info(bq->dev,"%s:reset vindpm threshold to 4600 successfully\n",__func__);
if (pe.enable) {
cancel_delayed_work_sync(&bq->monitor_work);