aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/ecard.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 65f1398723a4..f56d48c451ea 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -41,11 +41,11 @@
41#include <linux/init.h> 41#include <linux/init.h>
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/kthread.h> 43#include <linux/kthread.h>
44#include <linux/io.h>
44 45
45#include <asm/dma.h> 46#include <asm/dma.h>
46#include <asm/ecard.h> 47#include <asm/ecard.h>
47#include <asm/hardware.h> 48#include <asm/hardware.h>
48#include <asm/io.h>
49#include <asm/irq.h> 49#include <asm/irq.h>
50#include <asm/mmu_context.h> 50#include <asm/mmu_context.h>
51#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
@@ -966,6 +966,23 @@ void ecard_setirq(struct expansion_card *ec, const struct expansion_card_ops *op
966} 966}
967EXPORT_SYMBOL(ecard_setirq); 967EXPORT_SYMBOL(ecard_setirq);
968 968
969void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
970 unsigned long offset, unsigned long maxsize)
971{
972 unsigned long start = ecard_resource_start(ec, res);
973 unsigned long end = ecard_resource_end(ec, res);
974
975 if (offset > (end - start))
976 return NULL;
977
978 start += offset;
979 if (maxsize && end - start > maxsize)
980 end = start + maxsize;
981
982 return devm_ioremap(&ec->dev, start, end - start);
983}
984EXPORT_SYMBOL(ecardm_iomap);
985
969/* 986/*
970 * Probe for an expansion card. 987 * Probe for an expansion card.
971 * 988 *