diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-11-30 03:23:39 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-11-30 03:23:38 -0800 |
| commit | 645b7375729805a6086b48698a110307a7acc692 (patch) | |
| tree | 7306d962906dc3e0159a46c9b1d23da0f895ebd5 | |
| parent | ddf3b70d707569c022cce3f3e2b3cfc17fa30fc8 (diff) | |
| parent | 22e6fbc79fa7e64a9a29caf2def487a678b2b56b (diff) | |
Merge "smb1351: Fix parallel ICL configuration"
| -rw-r--r-- | drivers/power/supply/qcom/smb1351-charger.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/power/supply/qcom/smb1351-charger.c b/drivers/power/supply/qcom/smb1351-charger.c index 2dc16aadc4e8..9ba333a59d45 100644 --- a/drivers/power/supply/qcom/smb1351-charger.c +++ b/drivers/power/supply/qcom/smb1351-charger.c @@ -1597,7 +1597,7 @@ static int smb1351_parallel_set_property(struct power_supply *psy, enum power_supply_property prop, const union power_supply_propval *val) { - int rc = 0, index; + int rc = 0, index, current_ma; struct smb1351_charger *chip = power_supply_get_drvdata(psy); switch (prop) { @@ -1620,8 +1620,13 @@ static int smb1351_parallel_set_property(struct power_supply *psy, chip->target_fastchg_current_max_ma); break; case POWER_SUPPLY_PROP_CURRENT_MAX: - index = smb1351_get_closest_usb_setpoint(val->intval / 1000); - chip->usb_psy_ma = usb_chg_current[index]; + current_ma = val->intval / 1000; + if (current_ma > SUSPEND_CURRENT_MA) { + index = smb1351_get_closest_usb_setpoint(current_ma); + chip->usb_psy_ma = usb_chg_current[index]; + } else { + chip->usb_psy_ma = current_ma; + } if (!chip->parallel_charger_suspended) rc = smb1351_set_usb_chg_current(chip, chip->usb_psy_ma); |
