aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/ecard.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/ecard.c')
-rw-r--r--arch/arm/kernel/ecard.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index bdbd7da99286..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>
@@ -958,6 +958,31 @@ void ecard_release_resources(struct expansion_card *ec)
958} 958}
959EXPORT_SYMBOL(ecard_release_resources); 959EXPORT_SYMBOL(ecard_release_resources);
960 960
961void ecard_setirq(struct expansion_card *ec, const struct expansion_card_ops *ops, void *irq_data)
962{
963 ec->irq_data = irq_data;
964 barrier();
965 ec->ops = ops;
966}
967EXPORT_SYMBOL(ecard_setirq);
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
961/* 986/*
962 * Probe for an expansion card. 987 * Probe for an expansion card.
963 * 988 *
@@ -1133,6 +1158,14 @@ static int ecard_drv_remove(struct device *dev)
1133 drv->remove(ec); 1158 drv->remove(ec);
1134 ecard_release(ec); 1159 ecard_release(ec);
1135 1160
1161 /*
1162 * Restore the default operations. We ensure that the
1163 * ops are set before we change the data.
1164 */
1165 ec->ops = &ecard_default_ops;
1166 barrier();
1167 ec->irq_data = NULL;
1168
1136 return 0; 1169 return 0;
1137} 1170}
1138 1171