smb5: limit usb icl to 1000mA for OCP type

Limit the usb icl to 1000mA for OCP chargers(BELKIN 5V/1A)
to avoid sudden vbus loss when the current load over 1000mA.

Change-Id: Iad650afcb0263e861171223967d3ab5a688346c3
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1371196
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/1770268
This commit is contained in:
Yonghua Yan 2019-06-14 18:17:22 +08:00 • committed by Xiaojun Ji
commit a8e77d8c58
2 changed files with 4 additions and 0 deletions

View file

@ -5991,6 +5991,9 @@ static void smblib_handle_apsd_done(struct smb_charger *chg, bool rising)
smblib_notify_device_mode(chg, true);
break;
case OCP_CHARGER_BIT:
vote(chg->usb_icl_votable, SW_ICL_MAX_VOTER, true,
OCP_CURRENT_UA);
break;
case DCP_CHARGER_BIT:
break;
default:

View file

@ -96,6 +96,7 @@ enum print_reason {
#define SDP_100_MA 100000
#define SDP_CURRENT_UA 500000
#define OCP_CURRENT_UA 1000000
#define CDP_CURRENT_UA 1500000
#define DCP_CURRENT_UA 1500000
#define HVDCP_CURRENT_UA 3000000