From 44bf0b8116bfb7d0ccb46056f6fe09a062b0c548 Mon Sep 17 00:00:00 2001 From: Yonghua Yan Date: Thu, 30 May 2019 21:42:24 +0800 Subject: [PATCH] smb5: report effective icl value for current max Attach Turbo charger to a phone, its screen shows the messages: "Charging", followed by "Slowly Charging" and then finally "TurboPower connected". Display messages are confusing. This is because the USB ICL takes a period time to get settled down from low icl to the target icl. So here just return the target ICL to avoid this situation. Change-Id: I1a3e4641c31fde6b59cc017e01b26a6ea12c6d15 Signed-off-by: Yonghua Yan Reviewed-on: https://gerrit.mot.com/1364059 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Haijian Ma Reviewed-by: Huosheng Liao Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1770261 --- drivers/power/supply/qcom/qpnp-smb5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/qcom/qpnp-smb5.c b/drivers/power/supply/qcom/qpnp-smb5.c index 37527fcf1a9c..dd02103a5575 100644 --- a/drivers/power/supply/qcom/qpnp-smb5.c +++ b/drivers/power/supply/qcom/qpnp-smb5.c @@ -871,7 +871,7 @@ static int smb5_usb_get_prop(struct power_supply *psy, rc = smblib_get_prop_usb_current_now(chg, val); break; case POWER_SUPPLY_PROP_CURRENT_MAX: - rc = smblib_get_prop_input_current_max(chg, val); + val->intval = get_effective_result(chg->usb_icl_votable); break; case POWER_SUPPLY_PROP_TYPE: val->intval = POWER_SUPPLY_TYPE_USB_PD;