sbmcharger:optimize the pdo select

bangkk select the max current is beyond the sourcecap pdo.
Optimize the pdo max current when the pd power is lower than
18W.

Change-Id: Iaded43336951bcfbd9620d45a89c3517ccd058a9
Signed-off-by: Lei Chen <chenlei18@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2638964
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Lei Chen <chenl18@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Lei Chen 2023-06-09 11:12:55 +08:00 • committed by Lei Chen
commit ed5a5e73c0

View file

@ -2431,7 +2431,7 @@ static void mmi_chrg_usb_vin_pd_config(struct smb_mmi_charger *chg, int vbus_mv)
&& chg->mmi_pdo_info[i].uv_max >= MICRO_5V) {
req_pdo = chg->mmi_pdo_info[i].pdo_pos;
req_pd_volt = chg->mmi_pdo_info[i].uv_max;
req_pd_curr = (chg->pd_power_max / (req_pd_volt / 1000)) * 1000;
req_pd_curr = min((chg->pd_power_max / (req_pd_volt / 1000)) * 1000,chg->mmi_pdo_info[i].ua);
fixed_active = true;
}
}