Commit 07192604 authored by Boris BREZILLON's avatar Boris BREZILLON Committed by Nicolas Ferre

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: default avatarBoris BREZILLON <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
parent 91a55d4f
...@@ -206,6 +206,8 @@ static int at91_pm_enter(suspend_state_t state) ...@@ -206,6 +206,8 @@ static int at91_pm_enter(suspend_state_t state)
at91_pinctrl_gpio_suspend(); at91_pinctrl_gpio_suspend();
else else
at91_gpio_suspend(); at91_gpio_suspend();
if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base) {
at91_irq_suspend(); at91_irq_suspend();
pr_debug("AT91: PM - wake mask %08x, pm state %d\n", pr_debug("AT91: PM - wake mask %08x, pm state %d\n",
...@@ -216,6 +218,7 @@ static int at91_pm_enter(suspend_state_t state) ...@@ -216,6 +218,7 @@ static int at91_pm_enter(suspend_state_t state)
| (at91_get_extern_irq())) | (at91_get_extern_irq()))
& at91_aic_read(AT91_AIC_IMR), & at91_aic_read(AT91_AIC_IMR),
state); state);
}
switch (state) { switch (state) {
/* /*
...@@ -280,12 +283,17 @@ static int at91_pm_enter(suspend_state_t state) ...@@ -280,12 +283,17 @@ static int at91_pm_enter(suspend_state_t state)
goto error; goto error;
} }
if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base)
pr_debug("AT91: PM - wakeup %08x\n", pr_debug("AT91: PM - wakeup %08x\n",
at91_aic_read(AT91_AIC_IPR) & at91_aic_read(AT91_AIC_IMR)); at91_aic_read(AT91_AIC_IPR) &
at91_aic_read(AT91_AIC_IMR));
error: error:
target_state = PM_SUSPEND_ON; target_state = PM_SUSPEND_ON;
if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base)
at91_irq_resume(); at91_irq_resume();
if (of_have_populated_dt()) if (of_have_populated_dt())
at91_pinctrl_gpio_resume(); at91_pinctrl_gpio_resume();
else else
......
...@@ -49,6 +49,7 @@ void __init at91_init_irq_default(void) ...@@ -49,6 +49,7 @@ void __init at91_init_irq_default(void)
void __init at91_init_interrupts(unsigned int *priority) void __init at91_init_interrupts(unsigned int *priority)
{ {
/* Initialize the AIC interrupt controller */ /* Initialize the AIC interrupt controller */
if (IS_ENABLED(CONFIG_OLD_IRQ_AT91))
at91_aic_init(priority, at91_boot_soc.extern_irq); at91_aic_init(priority, at91_boot_soc.extern_irq);
/* Enable GPIO interrupts */ /* Enable GPIO interrupts */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment