summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramesh.chandrasekaran <ramesh.chandrasekaran@stericsson.com>2012-05-17 13:27:00 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-23 10:03:24 +0200
commit7f212ad0c3444a11428a66a88db92cc9f5229b79 (patch)
treedb457b640eda234e2884f1cac4b433deeb499890
parentec7a17810b1f5d5077393c85abf6bdb7a7c204af (diff)
pm: Fix for Basic Suspend/Resume to work
Signed-off-by: ramesh.chandrasekaran <ramesh.chandrasekaran@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/pm/context.c37
-rw-r--r--arch/arm/mach-ux500/pm/runtime.c7
2 files changed, 42 insertions, 2 deletions
diff --git a/arch/arm/mach-ux500/pm/context.c b/arch/arm/mach-ux500/pm/context.c
index e63fd4fbe8c..01040b6202f 100644
--- a/arch/arm/mach-ux500/pm/context.c
+++ b/arch/arm/mach-ux500/pm/context.c
@@ -32,6 +32,8 @@
#include "../product.h"
#include "../prcc.h"
+#include "../board-pins-sleep-force.h"
+
#define GPIO_NUM_BANKS 9
#define GPIO_NUM_SAVE_REGISTERS 7
@@ -638,6 +640,7 @@ void context_vape_restore(void)
void context_gpio_save(void)
{
int i;
+ unsigned int rimsc, fimsc;
for (i = 0; i < GPIO_NUM_BANKS; i++) {
gpio_save[i][0] = readl(gpio_bankaddr[i] + NMK_GPIO_AFSLA);
@@ -647,6 +650,22 @@ void context_gpio_save(void)
gpio_save[i][4] = readl(gpio_bankaddr[i] + NMK_GPIO_DAT);
gpio_save[i][6] = readl(gpio_bankaddr[i] + NMK_GPIO_SLPC);
}
+ /* Mask GPIO140 and GPIO32 which gives
+ * spurious interrupts during sleep
+ */
+ rimsc = readl(gpio_bankaddr[4] + NMK_GPIO_RIMSC);
+ fimsc = readl(gpio_bankaddr[4] + NMK_GPIO_FIMSC);
+ rimsc &= ~(0x1 << (140 % NMK_GPIO_PER_CHIP));
+ fimsc &= ~(0x1 << (140 % NMK_GPIO_PER_CHIP));
+ writel(rimsc, gpio_bankaddr[4] + NMK_GPIO_RIMSC);
+ writel(fimsc, gpio_bankaddr[4] + NMK_GPIO_FIMSC);
+
+ rimsc = readl(gpio_bankaddr[1] + NMK_GPIO_RIMSC);
+ fimsc = readl(gpio_bankaddr[1] + NMK_GPIO_FIMSC);
+ rimsc &= ~0x1;
+ fimsc &= ~0x1;
+ writel(rimsc, gpio_bankaddr[1] + NMK_GPIO_RIMSC);
+ writel(fimsc, gpio_bankaddr[1] + NMK_GPIO_FIMSC);
}
/*
@@ -660,6 +679,7 @@ void context_gpio_restore(void)
u32 pull_up;
u32 pull_down;
u32 pull;
+ unsigned int rimsc, fimsc;
for (i = 0; i < GPIO_NUM_BANKS; i++) {
writel(gpio_save[i][2], gpio_bankaddr[i] + NMK_GPIO_PDIS);
@@ -695,8 +715,23 @@ void context_gpio_restore(void)
writel(pull_down, gpio_bankaddr[i] + NMK_GPIO_DATC);
writel(gpio_save[i][6], gpio_bankaddr[i] + NMK_GPIO_SLPC);
-
}
+ /* Restore Masks for GPIO140 and GPIO32 which gives
+ * spurious interrupts during sleep
+ */
+ rimsc = readl(gpio_bankaddr[4] + NMK_GPIO_RIMSC);
+ fimsc = readl(gpio_bankaddr[4] + NMK_GPIO_FIMSC);
+ rimsc |= (0x1 << 140 % NMK_GPIO_PER_CHIP);
+ fimsc |= (0x1 << 140 % NMK_GPIO_PER_CHIP);
+ writel(rimsc, gpio_bankaddr[4] + NMK_GPIO_RIMSC);
+ writel(fimsc, gpio_bankaddr[4] + NMK_GPIO_FIMSC);
+
+ rimsc = readl(gpio_bankaddr[1] + NMK_GPIO_RIMSC);
+ fimsc = readl(gpio_bankaddr[1] + NMK_GPIO_FIMSC);
+ rimsc |= 0x1;
+ fimsc |= 0x1;
+ writel(rimsc, gpio_bankaddr[1] + NMK_GPIO_RIMSC);
+ writel(fimsc, gpio_bankaddr[1] + NMK_GPIO_FIMSC);
}
/*
diff --git a/arch/arm/mach-ux500/pm/runtime.c b/arch/arm/mach-ux500/pm/runtime.c
index 710bd8aae3d..8608c43479e 100644
--- a/arch/arm/mach-ux500/pm/runtime.c
+++ b/arch/arm/mach-ux500/pm/runtime.c
@@ -462,10 +462,15 @@ static int ux500_pd_bus_notify(struct notifier_block *nb,
struct dev_pm_domain ux500_amba_dev_power_domain = {
.ops = {
+ .suspend = amba_pm_suspend,
+ .resume = amba_pm_resume,
+ .freeze = amba_pm_freeze,
+ .thaw = amba_pm_thaw,
+ .poweroff = amba_pm_poweroff,
+ .restore = amba_pm_restore,
SET_RUNTIME_PM_OPS(ux500_pd_amba_runtime_suspend,
ux500_pd_amba_runtime_resume,
ux500_pd_amba_runtime_idle)
- USE_PLATFORM_PM_SLEEP_OPS
.suspend_noirq = ux500_pd_amba_suspend_noirq,
.resume_noirq = ux500_pd_amba_resume_noirq,
},