@@ -583,9 +583,9 @@ static void smb_status_change_work(struct work_struct *work)
case POWER_SUPPLY_USB_TYPE_CDP:
current_ua = CDP_CURRENT_UA;
break;
case POWER_SUPPLY_USB_TYPE_DCP:
- current_ua = DCP_CURRENT_UA;
+ current_ua = chip->batt_info->constant_charge_current_max_ua;
break;
case POWER_SUPPLY_USB_TYPE_SDP:
default:
current_ua = SDP_CURRENT_UA;
@@ -989,8 +989,10 @@ static int smb_probe(struct platform_device *pdev)
rc = power_supply_get_battery_info(chip->chg_psy, &chip->batt_info);
if (rc)
return dev_err_probe(chip->dev, rc,
"Failed to get battery info\n");
+ if (chip->batt_info->constant_charge_current_max_ua == -EINVAL)
+ chip->batt_info->constant_charge_current_max_ua = DCP_CURRENT_UA;
rc = devm_delayed_work_autocancel(chip->dev, &chip->status_change_work,
smb_status_change_work);
if (rc)
Respect the max current limit set on the battery node, one some devices this is set conservatively to avoid overheating since they only have a single charger IC (instead of two in parallel). Signed-off-by: Casey Connolly <casey.connolly@linaro.org> --- drivers/power/supply/qcom_smbx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)