diff options
author | Sai Krishna Juturi <jsaikrishna@codeaurora.org> | 2017-12-08 15:00:43 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-12-13 00:54:13 -0800 |
commit | ff9900827c20ef657ecc8a959486f72bbb7863a9 (patch) | |
tree | 8850546c6d5c1655050bc19a8fe50c150102f780 /drivers/usb/dwc3/dwc3-msm.c | |
parent | d3c7ac7bed27155b5173026f81b607cd6db5b365 (diff) |
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 <jsaikrishna@codeaurora.org>
Change-Id: Ibeeeafac0834c9df7099a3f0bad274ddb393de47
Diffstat (limited to 'drivers/usb/dwc3/dwc3-msm.c')
-rw-r--r-- | drivers/usb/dwc3/dwc3-msm.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |