charging: optimize select pd capacity

optimize select pd capacity to cover
more PD charger

Change-Id: Ie67c3b530f6cfb250508ecec72b12de537492969
Signed-off-by: Haijian Ma <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2310810
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
This commit is contained in:
Haijian Ma 2022-06-23 17:05:40 +08:00
commit d1a2cf641d

View file

@ -1088,13 +1088,9 @@ int mmi_charger_update_pd_capacity(struct mmi_charger_manager *chip)
chip->mmi_pd_pdo_idx,
chip->mmi_pdo_info.max_mv[chip->mmi_pd_pdo_idx],
chip->mmi_pdo_info.ma[chip->mmi_pd_pdo_idx]);
if ((max_mv * 1000) <= pd_volt_max_init) {
chip->pd_volt_max = max_mv * 1000;
}
if ((max_ma * 1000) <= pd_curr_max_init) {
chip->pd_curr_max = max_ma * 1000;
}
chip->pd_volt_max = min((max_mv * 1000), pd_volt_max_init);
chip->pd_curr_max = min((max_ma * 1000), pd_curr_max_init);
}