summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/gpc.c
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2015-09-03 01:05:48 +0800
committerAnson Huang <b20788@freescale.com>2015-09-03 01:34:41 +0800
commite4d0573ae88aa7e1216fa6dbc0fcbeb61cc70a49 (patch)
tree89f40ee835ffbca9ae12898f867b2b41f333fa2e /arch/arm/mach-imx/gpc.c
parentd9dd229076c09173b674becda8b57b94c61089bb (diff)
MLK-11492 ARM: imx: keep weak 2p5 on for USB vbus wakeuprel_imx_3.14.38_6ul_9x9_patch
Since i.MX6SX, if USB vbus wake up is enabled, weak 2P5 needs to be on even if the DRAM is LPDDR2, previously, we need to set stop_mode_config to keep 2P5 on, so enter DSM, if USB vbus wakeup is enabled, we need to keep weak 2P5 on. Signed-off-by: Anson Huang <b20788@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx/gpc.c')
-rw-r--r--arch/arm/mach-imx/gpc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index 88915c3232b6..6ee4127afb3f 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -62,6 +62,9 @@
#define DEFAULT_IPG_RATE 66000000
#define GPC_PU_UP_DELAY_MARGIN 2
+/* for irq #74 and #75 */
+#define GPC_USB_VBUS_WAKEUP_IRQ_MASK 0xc00
+
struct pu_domain {
struct generic_pm_domain base;
struct regulator *reg;
@@ -148,6 +151,24 @@ unsigned int imx_gpc_is_m4_sleeping(void)
return 0;
}
+bool imx_gpc_usb_wakeup_enabled(void)
+{
+ if (!(cpu_is_imx6sx() || cpu_is_imx6ul()))
+ return false;
+
+ /*
+ * for SoC later than i.MX6SX, USB vbus wakeup
+ * only needs weak 2P5 on, stop_mode_config is
+ * NOT needed, so we check if is USB vbus wakeup
+ * is enabled(assume irq #74 and #75) to decide
+ * if to keep weak 2P5 on.
+ */
+ if (gpc_wake_irqs[1] & GPC_USB_VBUS_WAKEUP_IRQ_MASK)
+ return true;
+
+ return false;
+}
+
unsigned int imx_gpc_is_mf_mix_off(void)
{
return readl_relaxed(gpc_base + GPC_PGC_MF_PDN);