@@ -1248,6 +1248,9 @@ static int ab8500_charger_set_vbus_in_curr(struct ab8500_charger *di,
if (di->max_usb_in_curr.set_max > 0)
min_value = min(di->max_usb_in_curr.set_max, min_value);
+ if (di->usb_state.usb_current >= 0)
+ min_value = min(di->usb_state.usb_current, min_value);
+
switch (min_value) {
case 100:
if (di->vbat < VBAT_TRESH_IP_CUR_RED)
@@ -3413,6 +3416,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
di->usb_chg.wdt_refresh = CHG_WD_INTERVAL;
di->usb_chg.enabled = di->pdata->usb_enabled;
di->usb_chg.external = false;
+ di->usb_state.usb_current = -1;
/* Create a work queue for the charger */
di->charger_wq =