Loading drivers/usb/dwc3/dwc3-msm.c +6 −1 Original line number Diff line number Diff line Loading @@ -3209,7 +3209,7 @@ static int dwc3_otg_start_peripheral(struct dwc3_msm *mdwc, int on) static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned mA) { union power_supply_propval pval = {1000 * mA}; union power_supply_propval pval = {0}; int ret; if (mdwc->charging_disabled) Loading @@ -3226,9 +3226,14 @@ static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned mA) } } power_supply_get_property(mdwc->usb_psy, POWER_SUPPLY_PROP_TYPE, &pval); if (pval.intval != POWER_SUPPLY_TYPE_USB) return 0; dev_info(mdwc->dev, "Avail curr from USB = %u\n", 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); if (ret) { Loading Loading
drivers/usb/dwc3/dwc3-msm.c +6 −1 Original line number Diff line number Diff line Loading @@ -3209,7 +3209,7 @@ static int dwc3_otg_start_peripheral(struct dwc3_msm *mdwc, int on) static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned mA) { union power_supply_propval pval = {1000 * mA}; union power_supply_propval pval = {0}; int ret; if (mdwc->charging_disabled) Loading @@ -3226,9 +3226,14 @@ static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned mA) } } power_supply_get_property(mdwc->usb_psy, POWER_SUPPLY_PROP_TYPE, &pval); if (pval.intval != POWER_SUPPLY_TYPE_USB) return 0; dev_info(mdwc->dev, "Avail curr from USB = %u\n", 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); if (ret) { Loading