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

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

Merge "usb: phy-msm-usb: Fix bug in handling POWER_SUPPLY_PROP_TYPE"

parents bd959acf bc795547
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -4198,6 +4198,20 @@ static int otg_power_set_property_usb(struct power_supply *psy,
	case POWER_SUPPLY_PROP_TYPE:
		psy->type = val->intval;

		/*
		 * If charger detection is done by the USB driver,
		 * motg->chg_type is already assigned in the
		 * charger detection work.
		 *
		 * There is a possibility of overriding the
		 * actual charger type with power supply type
		 * charger. For example USB PROPRIETARY charger
		 * does not exist in power supply enum and it
		 * gets overridden as DCP.
		 */
		if (motg->chg_state == USB_CHG_STATE_DETECTED)
			break;

		switch (psy->type) {
		case POWER_SUPPLY_TYPE_USB:
			motg->chg_type = USB_SDP_CHARGER;