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

Commit fa4a8d72 authored by Mian Yousaf Kaukab's avatar Mian Yousaf Kaukab Committed by Felipe Balbi
Browse files

usb: dwc2: gadget: fix phy interface configuration



hsotg->phyif is set in dwc2_gadget_init according to phy interface
width. Use it for configuration instead of hardcoded value.
Moreover, set USB turnaround time according to phy width.

Tested-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
Acked-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent ccb34a91
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -2290,8 +2290,9 @@ void s3c_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
	 */

	/* set the PLL on, remove the HNP/SRP and set the PHY */
	val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
	writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) |
	       (0x5 << 10), hsotg->regs + GUSBCFG);
	       (val << 10), hsotg->regs + GUSBCFG);

	s3c_hsotg_init_fifo(hsotg);

@@ -2978,6 +2979,7 @@ static void s3c_hsotg_phy_disable(struct dwc2_hsotg *hsotg)
 */
static void s3c_hsotg_init(struct dwc2_hsotg *hsotg)
{
	u32 trdtim;
	/* unmask subset of endpoint interrupts */

	writel(DIEPMSK_TIMEOUTMSK | DIEPMSK_AHBERRMSK |
@@ -3002,7 +3004,9 @@ static void s3c_hsotg_init(struct dwc2_hsotg *hsotg)
	s3c_hsotg_init_fifo(hsotg);

	/* set the PLL on, remove the HNP/SRP and set the PHY */
	writel(GUSBCFG_PHYIF16 | GUSBCFG_TOUTCAL(7) | (0x5 << 10),
	trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
	writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) |
		(trdtim << 10),
		hsotg->regs + GUSBCFG);

	if (using_dma(hsotg))