[PATCH 14/20] imx: provide helper macro to define IO_ADDRESS

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Wed Dec 16 13:59:55 EST 2009


Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
 arch/arm/plat-mxc/include/mach/hardware.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index 78db754..51a5435 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -22,6 +22,10 @@
 
 #include <asm/sizes.h>
 
+#define IMX_IO_ADDRESS(addr, module)\
+	(((unsigned long)((addr) - (module ## _BASE_ADDR)) < module ## _SIZE) ?\
+	(addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0)
+
 #ifdef CONFIG_ARCH_MX3
 #include <mach/mx3x.h>
 #include <mach/mx31.h>
-- 
1.6.5.2




More information about the linux-arm-kernel mailing list