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

Commit f6c01592 authored by Gregory Herrero's avatar Gregory Herrero Committed by Felipe Balbi
Browse files

usb: dwc2: gadget: register gadget handle to the phy



Bind peripheral controller to the phy on udc_start. Unbind on
udc_stop.

Tested-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarGregory Herrero <gregory.herrero@intel.com>
Signed-off-by: default avatarMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 487d60cc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2878,6 +2878,8 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget,
	}

	s3c_hsotg_phy_enable(hsotg);
	if (!IS_ERR_OR_NULL(hsotg->uphy))
		otg_set_peripheral(hsotg->uphy->otg, &hsotg->gadget);

	spin_lock_irqsave(&hsotg->lock, flags);
	s3c_hsotg_init(hsotg);
@@ -2927,6 +2929,8 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget)

	spin_unlock_irqrestore(&hsotg->lock, flags);

	if (!IS_ERR_OR_NULL(hsotg->uphy))
		otg_set_peripheral(hsotg->uphy->otg, NULL);
	s3c_hsotg_phy_disable(hsotg);

	regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);