LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 1/1] USB/EHCI: work for different PHY_CLK_VALID detecting order
@ 2013-04-24  6:47 Tiejun Chen
  0 siblings, 0 replies; only message in thread
From: Tiejun Chen @ 2013-04-24  6:47 UTC (permalink / raw)
  To: galak; +Cc: linux-usb, linuxppc-dev, linux-kernel

Due to different controller issue of PHY_CLK_VALID in ULPI mode,
in some cases, after set PHY_CLK_SEL, we should set
USB_CTRL_USB_EN before checking PHY_CLK_VALID, otherwise
PHY_CLK_VALID doesn't work.

But in other cases USB_CTRL_USB_EN is already set previously and
PHY_CLK_VALID is not valid once USB_CTRL_USB_EN is set. But
since PHY_CLK_VALID is w1c, we can force clear USB_CTRL_USB_EN
firstly after set PHY_CLK_SEL, then PHY_CLK_VALID status can
be kept even we re-set USB_CTRL_USB_EN.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
 drivers/usb/host/ehci-fsl.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index d81d2fc..57f2aa0 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -234,11 +234,20 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
 			/* controller version 1.6 or above */
 			setbits32(non_ehci + FSL_SOC_USB_CTRL,
 					ULPI_PHY_CLK_SEL);
+
 			/*
-			 * Due to controller issue of PHY_CLK_VALID in ULPI
-			 * mode, we set USB_CTRL_USB_EN before checking
-			 * PHY_CLK_VALID, otherwise PHY_CLK_VALID doesn't work.
+			 * Due to different controller issue of PHY_CLK_VALID
+			 * in ULPI mode, in some cases we should set
+			 * USB_CTRL_USB_EN before checking PHY_CLK_VALID,
+			 * otherwise PHY_CLK_VALID doesn't work.
+			 *
+			 * But in other cases USB_CTRL_USB_EN is already set
+			 * and PHY_CLK_VALID is not valid once USB_CTRL_USB_EN
+			 * is set. But since PHY_CLK_VALID is w1c, we can force
+			 * clear USB_CTRL_USB_EN firstly then PHY_CLK_VALID
+			 * status can be kept even we re-set USB_CTRL_USB_EN.
 			 */
+			clrbits32(non_ehci + FSL_SOC_USB_CTRL, USB_CTRL_USB_EN);
 			clrsetbits_be32(non_ehci + FSL_SOC_USB_CTRL,
 					UTMI_PHY_EN, USB_CTRL_USB_EN);
 		}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-24  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24  6:47 [RFC][PATCH 1/1] USB/EHCI: work for different PHY_CLK_VALID detecting order Tiejun Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox