From ff9900827c20ef657ecc8a959486f72bbb7863a9 Mon Sep 17 00:00:00 2001 From: Sai Krishna Juturi Date: Fri, 8 Dec 2017 15:00:43 +0530 Subject: dwc3-msm: Notify proper current values in case of floating charger Currently our driver is notifying ETIMEDOUT to PMIC incase of floating charger. Consider if we are inserting an SDP charger slowly that time also we will detect it as floating charger then also we are notifying ETIMEDOUT irrespective of current that is notified from gadget driver. Hence notify charging current properly if enumeration happens even in case of floating charger so that PMIC can update real charger type to SDP Signed-off-by: Sai Krishna Juturi Change-Id: Ibeeeafac0834c9df7099a3f0bad274ddb393de47 --- drivers/usb/dwc3/dwc3-msm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 26422a659bfc..0c992cfb3afa 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -3720,7 +3720,10 @@ static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned mA) psy_type = get_psy_type(mdwc); if (psy_type == POWER_SUPPLY_TYPE_USB_FLOAT) { - pval.intval = -ETIMEDOUT; + if (!mA) + pval.intval = -ETIMEDOUT; + else + pval.intval = 1000 * mA; goto set_prop; } -- cgit v1.2.3