diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 5783b002eb9a024effb9f4b478471463ff861483..73f496d5ba1a19f1c86d1d0e58e1f6faef0a57af 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -1415,7 +1415,7 @@ static int msm_otg_notify_power_supply(struct msm_otg *motg, unsigned mA) goto psy_error; if (power_supply_set_current_limit(psy, 1000*mA)) goto psy_error; - } else if (motg->cur_power > 0 && (mA == 0 || mA == 2)) { + } else if (mA == 0 || mA == 2) { /* Disable charging */ if (power_supply_set_online(psy, false)) goto psy_error; @@ -4841,6 +4841,7 @@ static int msm_otg_probe(struct platform_device *pdev) } motg->current_max = IDEV_CHG_MIN * 1000; + motg->cur_power = -EINVAL; motg->usb_psy.name = "usb"; motg->usb_psy.type = POWER_SUPPLY_TYPE_USB; diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 78a2ed4c05e96dcdd29f28e4c74559123049cc08..f2eff72b8fe839ceb4c23725e359a61db485d136 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h @@ -414,7 +414,7 @@ struct msm_otg { atomic_t in_lpm; atomic_t set_fpr_with_lpm_exit; int async_int; - unsigned cur_power; + int cur_power; struct delayed_work chg_work; struct delayed_work pmic_id_status_work; struct delayed_work suspend_work;