From: Boris BREZILLON <b.brezillon.dev@gmail.com>
To: Rob Landley <rob@landley.net>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Boris BREZILLON <b.brezillon.dev@gmail.com>
Subject: [RFC PATCH v2 04/10] ARM: at91: enclose at91_aic_xx calls in IS_ENABLED(CONFIG_OLD_IRQ_AT91) blocks
Date: Fri, 28 Mar 2014 18:59:02 +0100 [thread overview]
Message-ID: <1396029548-10928-5-git-send-email-b.brezillon.dev@gmail.com> (raw)
In-Reply-To: <1396029548-10928-1-git-send-email-b.brezillon.dev@gmail.com>
Enclose at91_aic_xx calls in IS_ENABLED(CONFIG_OLD_IRQ_AT91) blocks in
order to prepare the 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 <b.brezillon.dev@gmail.com>
---
arch/arm/mach-at91/pm.c | 32 ++++++++++++++++++++------------
arch/arm/mach-at91/setup.c | 3 ++-
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 590b52d..b9f4c5c 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -204,16 +204,19 @@ static int at91_pm_enter(suspend_state_t state)
at91_pinctrl_gpio_suspend();
else
at91_gpio_suspend();
- at91_irq_suspend();
- pr_debug("AT91: PM - wake mask %08x, pm state %d\n",
- /* remember all the always-wake irqs */
- (at91_pmc_read(AT91_PMC_PCSR)
- | (1 << AT91_ID_FIQ)
- | (1 << AT91_ID_SYS)
- | (at91_get_extern_irq()))
- & at91_aic_read(AT91_AIC_IMR),
- state);
+ if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base) {
+ at91_irq_suspend();
+
+ pr_debug("AT91: PM - wake mask %08x, pm state %d\n",
+ /* remember all the always-wake irqs */
+ (at91_pmc_read(AT91_PMC_PCSR)
+ | (1 << AT91_ID_FIQ)
+ | (1 << AT91_ID_SYS)
+ | (at91_get_extern_irq()))
+ & at91_aic_read(AT91_AIC_IMR),
+ state);
+ }
switch (state) {
/*
@@ -278,12 +281,17 @@ static int at91_pm_enter(suspend_state_t state)
goto error;
}
- pr_debug("AT91: PM - wakeup %08x\n",
- at91_aic_read(AT91_AIC_IPR) & at91_aic_read(AT91_AIC_IMR));
+ if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base)
+ pr_debug("AT91: PM - wakeup %08x\n",
+ at91_aic_read(AT91_AIC_IPR) &
+ at91_aic_read(AT91_AIC_IMR));
error:
target_state = PM_SUSPEND_ON;
- at91_irq_resume();
+
+ if (IS_ENABLED(CONFIG_OLD_IRQ_AT91) && at91_aic_base)
+ at91_irq_resume();
+
if (of_have_populated_dt())
at91_pinctrl_gpio_resume();
else
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index f7ca97b..1d8a6c8 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)
void __init at91_init_interrupts(unsigned int *priority)
{
/* Initialize the AIC interrupt controller */
- at91_aic_init(priority, at91_boot_soc.extern_irq);
+ if (IS_ENABLED(CONFIG_OLD_IRQ_AT91))
+ at91_aic_init(priority, at91_boot_soc.extern_irq);
/* Enable GPIO interrupts */
at91_gpio_irq_setup();
--
1.7.9.5
next prev parent reply other threads:[~2014-03-28 17:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 17:58 [RFC PATCH v2 00/10] ARM: at91: move aic driver to drivers/irqchips Boris BREZILLON
2014-03-28 17:58 ` [RFC PATCH v2 01/10] genirq: generic chip: export irq_map_generic_chip function Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 02/10] irqchip: atmel-aic: add new atmel AIC driver Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 03/10] ARM: at91: introduce OLD_IRQ_AT91 Kconfig option Boris BREZILLON
2014-03-29 9:06 ` Thomas Petazzoni
2014-03-29 9:12 ` Arnd Bergmann
2014-03-29 9:52 ` Boris BREZILLON
2014-03-28 17:59 ` Boris BREZILLON [this message]
2014-03-28 17:59 ` [RFC PATCH v2 05/10] ARM: at91: make use of the new AIC driver for dt enabled boards Boris BREZILLON
2014-03-29 9:07 ` Thomas Petazzoni
2014-03-29 10:11 ` Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 06/10] irqchip: atmel-aic: move binding doc to interrupt-controller directory Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 07/10] irqchip: atmel-aic: document new dt properties and children nodes Boris BREZILLON
2014-03-29 9:19 ` Thomas Petazzoni
2014-03-30 13:27 ` Boris BREZILLON
2014-03-30 14:55 ` Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 08/10] ARM: at91: remove old irq material Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 09/10] ARM: at91/dt: add new AIC irq mux definitions for sam9x5 SoCs Boris BREZILLON
2014-03-28 17:59 ` [RFC PATCH v2 10/10] ARM: at91/dt: add new AIC irq mux definitions for sama5 SoCs Boris BREZILLON
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1396029548-10928-5-git-send-email-b.brezillon.dev@gmail.com \
--to=b.brezillon.dev@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=plagnioj@jcrosoft.com \
--cc=rob@landley.net \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).