summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorLi Jun <jun.li@freescale.com>2015-01-29 10:26:52 +0800
committerLi Jun <jun.li@freescale.com>2015-01-29 12:47:42 +0800
commite30f0515912ee927c4724634090c3cb080fecda5 (patch)
tree0d5593950cd58fc5f767377ecf4b30d5122c87b7 /arch/arm/mach-imx
parentd138b927dc5742503bc18e6c7a36c47b7d02a03f (diff)
MLK-10174-1 arm: imx: gpc: export an interface to keep mega fast power
Add an interface for GPC used by drivers to keep mega fast mix domain power. Signed-off-by: Li Jun <jun.li@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/gpc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index f089ec2e5382..0f31e86295a3 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -71,6 +71,7 @@ static void __iomem *gpc_base;
static u32 gpc_mf_irqs[IMR_NUM];
static u32 gpc_wake_irqs[IMR_NUM];
static u32 gpc_saved_imrs[IMR_NUM];
+static u32 gpc_mf_request_on[IMR_NUM];
static u32 bypass;
static DEFINE_SPINLOCK(gpc_lock);
static struct notifier_block nb_pcie;
@@ -145,7 +146,8 @@ static void imx_gpc_mf_mix_off(void)
int i;
for (i = 0; i < IMR_NUM; i++)
- if ((gpc_wake_irqs[i] & gpc_mf_irqs[i]) != 0)
+ if (((gpc_wake_irqs[i] | gpc_mf_request_on[i]) &
+ gpc_mf_irqs[i]) != 0)
return;
pr_info("Turn off M/F mix!\n");
@@ -280,6 +282,22 @@ static int imx_pcie_regulator_notify(struct notifier_block *nb,
return NOTIFY_OK;
}
+int imx_gpc_mf_request_on(unsigned int irq, unsigned int on)
+{
+ unsigned int idx = irq / 32 - 1;
+ unsigned long flags;
+ u32 mask;
+
+ mask = 1 << (irq % 32);
+ spin_lock_irqsave(&gpc_lock, flags);
+ gpc_mf_request_on[idx] = on ? gpc_mf_request_on[idx] | mask :
+ gpc_mf_request_on[idx] & ~mask;
+ spin_unlock_irqrestore(&gpc_lock, flags);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(imx_gpc_mf_request_on);
+
void __init imx_gpc_init(void)
{
struct device_node *np;