public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] OMAP: INTC: use idle notifier for autoidle management
Date: Wed, 20 Oct 2010 16:31:22 -0700	[thread overview]
Message-ID: <1287617483-24170-2-git-send-email-khilman@deeprootsystems.com> (raw)
In-Reply-To: <1287617483-24170-1-git-send-email-khilman@deeprootsystems.com>

Move INTC autoidle management from custom hook to use the new idle
notifier.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/irq.c              |   36 +++++++++++++++++++++----------
 arch/arm/mach-omap2/pm34xx.c           |    3 --
 arch/arm/plat-omap/include/plat/irqs.h |    2 -
 3 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 32eeabe..cb51f74 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -14,10 +14,12 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/notifier.h>
+
+#include <plat/common.h>
 #include <mach/hardware.h>
 #include <asm/mach/irq.h>
 
-
 /* selected INTC register offsets */
 
 #define INTC_REVISION		0x0000
@@ -186,6 +188,24 @@ int omap_irq_pending(void)
 	return 0;
 }
 
+static int omap3_intc_idle_notifier(struct notifier_block *n,
+				      unsigned long val,
+				      void *p)
+{
+	if (val == OMAP_IDLE_START)
+		/* Disable autoidle as it can stall interrupt controller */
+		intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG);
+	else
+		/* Re-enable autoidle */
+		intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG);
+
+	return 0;
+}
+
+static struct notifier_block omap3_intc_notifier = {
+	.notifier_call = omap3_intc_idle_notifier,
+};
+
 void __init omap_init_irq(void)
 {
 	unsigned long nr_of_irqs = 0;
@@ -224,6 +244,9 @@ void __init omap_init_irq(void)
 		set_irq_handler(i, handle_level_irq);
 		set_irq_flags(i, IRQF_VALID);
 	}
+
+	if (cpu_is_omap34xx())
+		omap_idle_notifier_register(&omap3_intc_notifier);
 }
 
 #ifdef CONFIG_ARCH_OMAP3
@@ -282,15 +305,4 @@ void omap3_intc_suspend(void)
 	omap_ack_irq(0);
 }
 
-void omap3_intc_prepare_idle(void)
-{
-	/* Disable autoidle as it can stall interrupt controller */
-	intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG);
-}
-
-void omap3_intc_resume_idle(void)
-{
-	/* Re-enable autoidle */
-	intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG);
-}
 #endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 713bd04..4674748 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -407,8 +407,6 @@ void omap_sram_idle(void)
 		}
 	}
 
-	omap3_intc_prepare_idle();
-
 	/*
 	* On EMU/HS devices ROM code restores a SRDC value
 	* from scratchpad which has automatic self refresh on timeout
@@ -454,7 +452,6 @@ void omap_sram_idle(void)
 					       OMAP3430_GR_MOD,
 					       OMAP3_PRM_VOLTCTRL_OFFSET);
 	}
-	omap3_intc_resume_idle();
 
 	/* PER */
 	if (per_next_state < PWRDM_POWER_ON) {
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 65e20a6..b87c211 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -424,8 +424,6 @@ extern int omap_irq_pending(void);
 void omap_intc_save_context(void);
 void omap_intc_restore_context(void);
 void omap3_intc_suspend(void);
-void omap3_intc_prepare_idle(void);
-void omap3_intc_resume_idle(void);
 #endif
 
 #include <mach/hardware.h>
-- 
1.7.2.1


  reply	other threads:[~2010-10-20 23:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20 23:31 [PATCH 1/3] OMAP: PM: formalize idle notifications Kevin Hilman
2010-10-20 23:31 ` Kevin Hilman [this message]
2010-10-20 23:31 ` [PATCH 3/3] OMAP: UART: use atomic idle notifiers Kevin Hilman
2010-10-22 12:54   ` Govindraj
2010-10-22 16:11     ` Kevin Hilman
2010-10-22 18:05 ` [PATCH 1/3] OMAP: PM: formalize idle notifications Tony Lindgren
2010-10-22 22:00   ` Kevin Hilman

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=1287617483-24170-2-git-send-email-khilman@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    /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