power: smb-lib: Set charge current to 100mA when USB is not enumerated

In case of wearables, USB enumeration may fail due to the unclean USB
pins. In this case USB driver notifies charger driver with -ETIMEDOUT.
Set charge current to minimum of 100mA to enable charging.

Change-Id: I9bc87fb3e22841c2e89736c70b71a29428311d31
Signed-off-by: Umang Chheda <uchheda@codeaurora.org>
This commit is contained in:
Umang Chheda 2019-11-12 11:54:07 +05:30 committed by Gerrit - the friendly Code Review server
parent 560e99293a
commit 870449e6c3

View File

@ -2759,6 +2759,10 @@ static int smblib_handle_usb_current(struct smb_charger *chg,
if (rc < 0)
return rc;
}
} else if (chg->real_charger_type == POWER_SUPPLY_TYPE_USB &&
usb_current == -ETIMEDOUT) {
rc = vote(chg->usb_icl_votable, USB_PSY_VOTER,
true, USBIN_100MA);
} else {
rc = vote(chg->usb_icl_votable, USB_PSY_VOTER,
true, usb_current);