diff options
author | Martin Bergstrom <martin.bergstrom@stericsson.com> | 2012-08-22 11:13:07 +0200 |
---|---|---|
committer | Mathieu J. Poirier <mathieu.poirier@linaro.org> | 2012-09-18 07:54:47 -0600 |
commit | 7c8f28c668080ade4ca99fca702f11e80f237afa (patch) | |
tree | 58e4e480b9341494690fe8a087bbb93a845a093b | |
parent | a473ccd2f26e53ef538e3b325eb7060338b5ac14 (diff) |
power: charger: Limit USB charger currentbattery-2.6.git
The USB charger current is limited according to information comming
from the USB driver
Signed-off-by: Martin Bergstrom <martin.bergstrom@stericsson.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | drivers/power/ab8500_charger.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index ff412ccd6d00..d1e64555cd85 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@ -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 = |