]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MLK-10088-14 usb: phy: phy-mxs-usb: add power down and disable wakeup for .shutdown
authorPeter Chen <peter.chen@freescale.com>
Wed, 24 Dec 2014 03:11:52 +0000 (11:11 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:19:09 +0000 (21:19 -0600)
When we shut down the PHY, we need to power down all PHY's functions
as well as disable wakeup, it is the opposite operation we do at .init.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/phy/phy-mxs-usb.c

index 0e0c41587a08b77cea9e49178de1c420a67405dc..cca00b7fa42584761b3c039a109c391c31f5cff8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-2014 Freescale Semiconductor, Inc.
+ * Copyright 2012-2015 Freescale Semiconductor, Inc.
  * Copyright (C) 2012 Marek Vasut <marex@denx.de>
  * on behalf of DENX Software Engineering GmbH
  *
@@ -293,6 +293,17 @@ static int mxs_phy_init(struct usb_phy *phy)
 static void mxs_phy_shutdown(struct usb_phy *phy)
 {
        struct mxs_phy *mxs_phy = to_mxs_phy(phy);
+       u32 value = BM_USBPHY_CTRL_ENVBUSCHG_WKUP |
+                       BM_USBPHY_CTRL_ENDPDMCHG_WKUP |
+                       BM_USBPHY_CTRL_ENIDCHG_WKUP |
+                       BM_USBPHY_CTRL_ENAUTOSET_USBCLKS |
+                       BM_USBPHY_CTRL_ENAUTOCLR_USBCLKGATE |
+                       BM_USBPHY_CTRL_ENAUTOCLR_PHY_PWD |
+                       BM_USBPHY_CTRL_ENAUTOCLR_CLKGATE |
+                       BM_USBPHY_CTRL_ENAUTO_PWRON_PLL;
+
+       writel(value, phy->io_priv + HW_USBPHY_CTRL_CLR);
+       writel(0xffffffff, phy->io_priv + HW_USBPHY_PWD);
 
        writel(BM_USBPHY_CTRL_CLKGATE,
               phy->io_priv + HW_USBPHY_CTRL_SET);