[PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

Shawn Guo shawn.guo at linaro.org
Thu Jun 14 01:59:46 EDT 2012


The commit a2be01b (ARM: only include mach/irqs.h for !SPARSE_IRQ)
makes mach/irqs.h only be included for !SPARSE_IRQ build.  There are
a nubmer of platforms have FIQ_START defined in mach/irqs.h.

  arch/arm/mach-at91/include/mach/irqs.h:#define FIQ_START AT91_ID_FIQ
  arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START         64
  arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START             IRQ_EINT0
  arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0
  arch/arm/plat-omap/include/plat/irqs.h:#define FIQ_START                1024

If SPARSE_IRQ is enabled for any of these platforms, the following
compile error will be seen.

  arch/arm/kernel/fiq.c: In function ‘enable_fiq’:
  arch/arm/kernel/fiq.c:127:19: error: ‘FIQ_START’ undeclared (first use in this function)
  arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
  arch/arm/kernel/fiq.c: In function ‘disable_fiq’:
  arch/arm/kernel/fiq.c:132:20: error: ‘FIQ_START’ undeclared (first use in this function)

Though FIQ_START is defined in above 5 platforms, a grep on the whole
tree only reports the following users of enable_fiq/disable_fiq.

  arch/arm/mach-rpc/dma.c
  drivers/media/video/mx1_camera.c
  sound/soc/fsl/imx-pcm-fiq.c

That said, only rpc and imx are actually using enable_fiq/disable_fiq.

The patch changes enable_fiq/disable_fiq a little bit to have the
absolute fiq number than offset passed into by parameter "fiq".  While
fiq on imx starts from 0, only rpc needs a fix-up to adapt the change.

With this change, all those FIQ_START definitions in platform irqs.h
can be removed now, but we chose to leave the decision to platform
maintainers, it should be removed or just left there as a document
on where fiq starts on the platform.

Signed-off-by: Shawn Guo <shawn.guo at linaro.org>
Cc: Russell King <linux at arm.linux.org.uk>
Cc: Nicolas Ferre <nicolas.ferre at atmel.com>
Cc: Tony Lindgren <tony at atomide.com>
Cc: Kukjin Kim <kgene.kim at samsung.com>
---
 arch/arm/kernel/fiq.c                 |    4 ++--
 arch/arm/mach-rpc/include/mach/irqs.h |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index c32f845..5953bea 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -124,12 +124,12 @@ void release_fiq(struct fiq_handler *f)
 
 void enable_fiq(int fiq)
 {
-	enable_irq(fiq + FIQ_START);
+	enable_irq(fiq);
 }
 
 void disable_fiq(int fiq)
 {
-	disable_irq(fiq + FIQ_START);
+	disable_irq(fiq);
 }
 
 EXPORT_SYMBOL(set_fiq_handler);
diff --git a/arch/arm/mach-rpc/include/mach/irqs.h b/arch/arm/mach-rpc/include/mach/irqs.h
index 6868e17..4962bdd 100644
--- a/arch/arm/mach-rpc/include/mach/irqs.h
+++ b/arch/arm/mach-rpc/include/mach/irqs.h
@@ -31,15 +31,15 @@
 #define IRQ_DMAS0		20
 #define IRQ_DMAS1		21
 
-#define FIQ_FLOPPYDATA		0
-#define FIQ_ECONET		2
-#define FIQ_SERIALPORT		4
-#define FIQ_EXPANSIONCARD	6
-#define FIQ_FORCE		7
-
 /*
  * This is the offset of the FIQ "IRQ" numbers
  */
 #define FIQ_START		64
 
+#define FIQ_FLOPPYDATA		(FIQ_START + 0)
+#define FIQ_ECONET		(FIQ_START + 2)
+#define FIQ_SERIALPORT		(FIQ_START + 4)
+#define FIQ_EXPANSIONCARD	(FIQ_START + 6)
+#define FIQ_FORCE		(FIQ_START + 7)
+
 #define NR_IRQS			128
-- 
1.7.5.4





More information about the linux-arm-kernel mailing list