]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00225131-06 MX6 PM: clear stop_mode_config after system resume
authormake shi <b15407@freescale.com>
Thu, 20 Sep 2012 09:20:14 +0000 (17:20 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:27 +0000 (08:35 +0200)
- If stop_mode_config is set as 1, the USB otg vbus wakeup system can be
  supported
- After system resume, need clear stop_mode_config bit to keep the 1P1
  default off

Signed-off-by: make shi <b15407@freescale.com>
arch/arm/mach-mx6/pm.c

index 20139e0b9594e87988819d102f3c81f74c5cff4b..40e0d39470bdb90595cf870b9543fa17f9558e97 100644 (file)
@@ -38,6 +38,7 @@
 #endif
 #include "crm_regs.h"
 #include "src-reg.h"
+#include "regs-anadig.h"
 
 #define SCU_CTRL_OFFSET                                0x00
 #define GPC_IMR1_OFFSET                                0x08
@@ -122,6 +123,11 @@ static void usb_power_down_handler(void)
 {
        u32 temp;
        bool usb_oh3_clk_already_on;
+       if ((__raw_readl(anatop_base + HW_ANADIG_ANA_MISC0)
+               & BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG) != 0) {
+                       usb_vbus_wakeup_enabled = false;
+                       return;
+       }
        /* enable usb oh3 clock if needed*/
        temp = __raw_readl(MXC_CCM_CCGR6);
        usb_oh3_clk_already_on =        \
@@ -433,6 +439,9 @@ static int mx6_suspend_enter(suspend_state_t state)
 
                mx6_suspend_restore();
 
+               __raw_writel(BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG,
+                       anatop_base + HW_ANADIG_ANA_MISC0_CLR);
+
                if (pm_data && pm_data->suspend_exit)
                        pm_data->suspend_exit();
        } else {