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

Commit 4fe4c35a authored by Lena Salman's avatar Lena Salman
Browse files

usb: dwc3: Add USB host OTG capability



On some targets like 9x35, the ID notification is wired via
SMB. Add here the support of getting external ID
notification and by this allowing the capability of
switching host-device and vice versa on the go.

Change-Id: I37c2a68b9b355ee8c0e39627aeff82c14566f636
Signed-off-by: default avatarLena Salman <esalman@codeaurora.org>
parent 4713870e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2180,6 +2180,17 @@ static int dwc3_msm_power_set_property_usb(struct power_supply *psy,
								usb_psy);

	switch (psp) {
	case POWER_SUPPLY_PROP_USB_OTG:
		/* Let OTG know about ID detection */
		mdwc->id_state = val->intval ? DWC3_ID_GROUND : DWC3_ID_FLOAT;
		if (mdwc->otg_xceiv && !mdwc->ext_inuse &&
		    (mdwc->ext_xceiv.otg_capability)) {
			mdwc->ext_xceiv.id = mdwc->id_state;
			queue_delayed_work(system_nrt_wq,
							&mdwc->resume_work, 12);
		}

		break;
	case POWER_SUPPLY_PROP_SCOPE:
		mdwc->scope = val->intval;
		if (mdwc->scope == POWER_SUPPLY_SCOPE_SYSTEM) {