Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2d7b195 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3-msm: Only set vbus_draw for SDP type"

parents 5c5e1657 ffedac17
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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)
@@ -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) {