From 97ed757748af86fa2ce0357499c8eade6a7a8e26 Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Tue, 7 Apr 2020 10:52:11 -0700 Subject: [PATCH] usb: dwc3-msm: Use PROP_INPUT_CURRENT_LIMIT to for vbus_draw The charger driver expects USB to indicate the amount of VBUS current to draw while in peripheral mode using the power_supply property POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT instead of POWER_SUPPLY_PROP_CURRENT_MAX, as the latter is intended as a read-only property which indicates the actual maximum current that the charger HW is allowed to draw. Change-Id: Icaab0032d9f545610f91c23bf5624095b1123317 Signed-off-by: Jack Pham --- drivers/usb/dwc3/dwc3-msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 48249d1f0c0d..329c7c39e9d4 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -4703,7 +4703,7 @@ static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned int mA) /* Set max current limit in uA */ pval.intval = 1000 * mA; ret = power_supply_set_property(mdwc->usb_psy, - POWER_SUPPLY_PROP_CURRENT_MAX, &pval); + POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &pval); if (ret) { dev_dbg(mdwc->dev, "power supply error when setting property\n"); return ret;