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 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1364059
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1770261
This commit is contained in:
Yonghua Yan 2019-05-30 21:42:24 +08:00 • committed by Xiaojun Ji
commit 44bf0b8116

View file

@ -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;