summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshay Jaiswal <ashayj@codeaurora.org>2017-11-27 12:41:02 +0530
committerAshay Jaiswal <ashayj@codeaurora.org>2017-11-27 14:10:30 +0530
commit22e6fbc79fa7e64a9a29caf2def487a678b2b56b (patch)
treefc9d9943b2c9dc28eadd925f894046c2aca7859e
parent1ecbc6d7ead288248e46defc5759e96ddf6d16ef (diff)
smb1351: Fix parallel ICL configuration
In slave configuration "POWER_SUPPLY_PROP_CURRENT_MAX" fails to suspend USB input path for 0/2mA current request. Fix this by separately handling 0/2mA request to suspend input. CRs-Fixed: 2148379 Change-Id: Id9b7887c4f2f924d9e4c8484947d74baa96eb8a3 Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
-rw-r--r--drivers/power/supply/qcom/smb1351-charger.c11
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);