aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2014-07-10 13:14:20 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2014-08-19 14:32:48 -0400
commit071926041e5b38f84f2aaac2122c57e398e535b5 (patch)
tree45eb6c3e89b9b4038ee4300cda5b80ffc16db156
parent91a55d4f690066a249d5cdeca86f0c3164301861 (diff)
ARM: at91: enclose at91_aic_xx calls in IS_ENABLED(CONFIG_OLD_IRQ_AT91) blocks
Enclose at91_aic_xx calls in IS_ENABLED(CONFIG_OLD_IRQ_AT91) blocks in order to prepare migration to the new AIC driver. In the new AIC driver the suspend/resume functions are called by the generic irq framework and are no longer needed in the PM specific code. Moreover, the new AIC driver no longer exposes the at91_aic_base variable which is used by the at91_aic_read functions. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-rw-r--r--arch/arm/mach-at91/pm.c32
-rw-r--r--arch/arm/mach-at91/setup.c3
2 files changed, 22 insertions, 13 deletions
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index e95554532987..5920373809c5 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -206,16 +206,19 @@ static int at91_pm_enter(suspend_state_t state)
206 at91_pinctrl_gpio_suspend(); 206 at91_pinctrl_gpio_suspend();
207 else 207 else
208 at91_gpio_suspend(); 208 at91_gpio_suspend();
209 at91_irq_suspend();
210 209
211 pr_debug("AT91: PM - wake mask %08x, pm state %d\n", 210 if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base) {
212 /* remember all the always-wake irqs */ 211 at91_irq_suspend();
213 (at91_pmc_read(AT91_PMC_PCSR) 212
214 | (1 << AT91_ID_FIQ) 213 pr_debug("AT91: PM - wake mask %08x, pm state %d\n",
215 | (1 << AT91_ID_SYS) 214 /* remember all the always-wake irqs */
216 | (at91_get_extern_irq())) 215 (at91_pmc_read(AT91_PMC_PCSR)
217 & at91_aic_read(AT91_AIC_IMR), 216 | (1 << AT91_ID_FIQ)
218 state); 217 | (1 << AT91_ID_SYS)
218 | (at91_get_extern_irq()))
219 & at91_aic_read(AT91_AIC_IMR),
220 state);
221 }
219 222
220 switch (state) { 223 switch (state) {
221 /* 224 /*
@@ -280,12 +283,17 @@ static int at91_pm_enter(suspend_state_t state)
280 goto error; 283 goto error;
281 } 284 }
282 285
283 pr_debug("AT91: PM - wakeup %08x\n", 286 if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base)
284 at91_aic_read(AT91_AIC_IPR) & at91_aic_read(AT91_AIC_IMR)); 287 pr_debug("AT91: PM - wakeup %08x\n",
288 at91_aic_read(AT91_AIC_IPR) &
289 at91_aic_read(AT91_AIC_IMR));
285 290
286error: 291error:
287 target_state = PM_SUSPEND_ON; 292 target_state = PM_SUSPEND_ON;
288 at91_irq_resume(); 293
294 if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base)
295 at91_irq_resume();
296
289 if (of_have_populated_dt()) 297 if (of_have_populated_dt())
290 at91_pinctrl_gpio_resume(); 298 at91_pinctrl_gpio_resume();
291 else 299 else
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index f7a07a58ebb6..0bf893a574f9 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -49,7 +49,8 @@ void __init at91_init_irq_default(void)
49void __init at91_init_interrupts(unsigned int *priority) 49void __init at91_init_interrupts(unsigned int *priority)
50{ 50{
51 /* Initialize the AIC interrupt controller */ 51 /* Initialize the AIC interrupt controller */
52 at91_aic_init(priority, at91_boot_soc.extern_irq); 52 if (IS_ENABLED(CONFIG_OLD_IRQ_AT91))
53 at91_aic_init(priority, at91_boot_soc.extern_irq);
53 54
54 /* Enable GPIO interrupts */ 55 /* Enable GPIO interrupts */
55 at91_gpio_irq_setup(); 56 at91_gpio_irq_setup();