Commit 1e48fd05 authored by Justin Chen's avatar Justin Chen Committed by Vinod Koul
Browse files

phy: usb: disable COMMONONN for dual mode



The COMMONONN bit suspends the phy when the port is put into a suspend
state. However when the phy is shared between host and device in dual
mode, this no longer works cleanly as there is no synchronization between
the two.

Fixes: 5095d045 ("phy: usb: Turn off phy when port is in suspend")
Signed-off-by: default avatarJustin Chen <justin.chen@broadcom.com>
Acked-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20241010185344.859865-1-justin.chen@broadcom.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 2d0f973b
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -153,7 +153,9 @@ static void xhci_soft_reset(struct brcm_usb_init_params *params,
	} else {
		USB_CTRL_SET(ctrl, USB_PM, XHC_SOFT_RESETB);
		/* Required for COMMONONN to be set */
		USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG, U2_FREECLK_EXISTS);
		if (params->supported_port_modes != USB_CTLR_MODE_DRD)
			USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG,
					   U2_FREECLK_EXISTS);
	}
}

@@ -328,7 +330,11 @@ static void usb_init_common_7216(struct brcm_usb_init_params *params)
	/* 1 millisecond - for USB clocks to settle down */
	usleep_range(1000, 2000);

	/* Disable PHY when port is suspended */
	/*
	 * Disable PHY when port is suspended
	 * Does not work in DRD mode
	 */
	if (params->supported_port_modes != USB_CTLR_MODE_DRD)
		USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN);

	usb_wake_enable_7216(params, false);