diff options
-rw-r--r-- | arch/arm/mach-imx/gpc.c | 20 | ||||
-rw-r--r-- | include/linux/imx_gpc.h | 25 |
2 files changed, 44 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; diff --git a/include/linux/imx_gpc.h b/include/linux/imx_gpc.h new file mode 100644 index 000000000000..2cffa4be22aa --- /dev/null +++ b/include/linux/imx_gpc.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2015 Freescale Semiconductor, Inc. + */ + +/* + * The code contained herein is licensed under the GNU Lesser General + * Public License. You may obtain a copy of the GNU Lesser General + * Public License Version 2.1 or later at the following locations: + * + * http://www.opensource.org/licenses/lgpl-license.html + * http://www.gnu.org/copyleft/lgpl.html + */ + +/* + * @file linux/imx_gpc.h + * + * @brief Global header file for imx GPC + * + * @ingroup GPC + */ +#ifndef __LINUX_IMX_GPC_H__ +#define __LINUX_IMX_GPC_H__ + +int imx_gpc_mf_request_on(unsigned int irq, unsigned int on); +#endif /* __LINUX_IMX_GPC_H__ */ |