aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorAlex Dubov <oakad@yahoo.com>2007-04-12 16:59:12 +1000
committerPierre Ossman <drzeus@drzeus.cx>2007-05-01 13:04:12 +0200
commit4552f0cbd45225f2c1cbadc224505f14f8749569 (patch)
tree026448e7321fa5c24f3f85c7f330fe112241c901 /drivers/misc
parent5721dbf217b073b40e31936781379ab2d17ea2ae (diff)
tifm: hide details of interrupt processing from socket drivers
Instead of passing transformed value of adapter interrupt status to socket drivers, implement two separate callbacks - one for card events and another for dma events. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/tifm_7xx1.c22
-rw-r--r--drivers/misc/tifm_core.c11
2 files changed, 20 insertions, 13 deletions
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index bc60e2fc3c2..d6652b3301d 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -14,7 +14,13 @@
#include <linux/freezer.h>
#define DRIVER_NAME "tifm_7xx1"
-#define DRIVER_VERSION "0.7"
+#define DRIVER_VERSION "0.8"
+
+#define TIFM_IRQ_ENABLE 0x80000000
+#define TIFM_IRQ_SOCKMASK(x) (x)
+#define TIFM_IRQ_CARDMASK(x) ((x) << 8)
+#define TIFM_IRQ_FIFOMASK(x) ((x) << 16)
+#define TIFM_IRQ_SETALL 0xffffffff
static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock)
{
@@ -31,7 +37,7 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
struct tifm_adapter *fm = dev_id;
struct tifm_dev *sock;
unsigned int irq_status;
- unsigned int sock_irq_status, cnt;
+ unsigned int cnt;
spin_lock(&fm->lock);
irq_status = readl(fm->addr + FM_INTERRUPT_STATUS);
@@ -45,12 +51,12 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
for (cnt = 0; cnt < fm->num_sockets; cnt++) {
sock = fm->sockets[cnt];
- sock_irq_status = (irq_status >> cnt)
- & (TIFM_IRQ_FIFOMASK(1)
- | TIFM_IRQ_CARDMASK(1));
-
- if (sock && sock_irq_status)
- sock->signal_irq(sock, sock_irq_status);
+ if (sock) {
+ if ((irq_status >> cnt) & TIFM_IRQ_FIFOMASK(1))
+ sock->data_event(sock);
+ if ((irq_status >> cnt) & TIFM_IRQ_CARDMASK(1))
+ sock->card_event(sock);
+ }
}
fm->socket_change_set |= irq_status
diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c
index 6b10ebe9d93..6799b9cca05 100644
--- a/drivers/misc/tifm_core.c
+++ b/drivers/misc/tifm_core.c
@@ -14,7 +14,7 @@
#include <linux/idr.h>
#define DRIVER_NAME "tifm_core"
-#define DRIVER_VERSION "0.7"
+#define DRIVER_VERSION "0.8"
static DEFINE_IDR(tifm_adapter_idr);
static DEFINE_SPINLOCK(tifm_adapter_lock);
@@ -175,8 +175,7 @@ void tifm_free_device(struct device *dev)
}
EXPORT_SYMBOL(tifm_free_device);
-static void tifm_dummy_signal_irq(struct tifm_dev *sock,
- unsigned int sock_irq_status)
+static void tifm_dummy_event(struct tifm_dev *sock)
{
return;
}
@@ -191,7 +190,8 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm)
dev->dev.parent = fm->dev;
dev->dev.bus = &tifm_bus_type;
dev->dev.release = tifm_free_device;
- dev->signal_irq = tifm_dummy_signal_irq;
+ dev->card_event = tifm_dummy_event;
+ dev->data_event = tifm_dummy_event;
}
return dev;
}
@@ -249,7 +249,8 @@ static int tifm_device_remove(struct device *dev)
struct tifm_driver *drv = fm_dev->drv;
if (drv) {
- fm_dev->signal_irq = tifm_dummy_signal_irq;
+ fm_dev->card_event = tifm_dummy_event;
+ fm_dev->data_event = tifm_dummy_event;
if (drv->remove)
drv->remove(fm_dev);
fm_dev->drv = NULL;