diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index 9b98589525e0..af7733c097d7 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -960,6 +960,11 @@ static void bq25890_set_pd_param(struct bq25890_device *bq, int vol, int cur) i++; } + if (cur <= 500000) + bq25890_field_write(bq, F_AUTO_DPDM_EN, 1); + else + bq25890_field_write(bq, F_AUTO_DPDM_EN, 0); + bq25890_field_write(bq, F_IILIM, iilim); bq25890_field_write(bq, F_VINDPM_OFS, vindpm); bq25890_field_write(bq, F_ICHG, ichg); @@ -996,7 +1001,6 @@ static int bq25890_pd_notifier_call(struct notifier_block *nb, if (prop.intval == 0) { bq->pd_cur = 450000; bq->pd_vol = 5000000; - bq25890_field_write(bq, F_AUTO_DPDM_EN, 1); queue_delayed_work(bq->charger_wq, &bq->pd_work, msecs_to_jiffies(10)); return NOTIFY_OK; @@ -1013,7 +1017,6 @@ static int bq25890_pd_notifier_call(struct notifier_block *nb, return NOTIFY_OK; bq->pd_vol = prop.intval; - bq25890_field_write(bq, F_AUTO_DPDM_EN, 0); queue_delayed_work(bq->charger_wq, &bq->pd_work, msecs_to_jiffies(100)); }