diff options
author | Alex Dubov <oakad@yahoo.com> | 2007-04-12 02:59:12 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-05-01 07:04:12 -0400 |
commit | 4552f0cbd45225f2c1cbadc224505f14f8749569 (patch) | |
tree | 026448e7321fa5c24f3f85c7f330fe112241c901 /drivers/misc/tifm_7xx1.c | |
parent | 5721dbf217b073b40e31936781379ab2d17ea2ae (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/tifm_7xx1.c')
-rw-r--r-- | drivers/misc/tifm_7xx1.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index bc60e2fc3c2c..d6652b3301dc 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c | |||
@@ -14,7 +14,13 @@ | |||
14 | #include <linux/freezer.h> | 14 | #include <linux/freezer.h> |
15 | 15 | ||
16 | #define DRIVER_NAME "tifm_7xx1" | 16 | #define DRIVER_NAME "tifm_7xx1" |
17 | #define DRIVER_VERSION "0.7" | 17 | #define DRIVER_VERSION "0.8" |
18 | |||
19 | #define TIFM_IRQ_ENABLE 0x80000000 | ||
20 | #define TIFM_IRQ_SOCKMASK(x) (x) | ||
21 | #define TIFM_IRQ_CARDMASK(x) ((x) << 8) | ||
22 | #define TIFM_IRQ_FIFOMASK(x) ((x) << 16) | ||
23 | #define TIFM_IRQ_SETALL 0xffffffff | ||
18 | 24 | ||
19 | static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock) | 25 | static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock) |
20 | { | 26 | { |
@@ -31,7 +37,7 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id) | |||
31 | struct tifm_adapter *fm = dev_id; | 37 | struct tifm_adapter *fm = dev_id; |
32 | struct tifm_dev *sock; | 38 | struct tifm_dev *sock; |
33 | unsigned int irq_status; | 39 | unsigned int irq_status; |
34 | unsigned int sock_irq_status, cnt; | 40 | unsigned int cnt; |
35 | 41 | ||
36 | spin_lock(&fm->lock); | 42 | spin_lock(&fm->lock); |
37 | irq_status = readl(fm->addr + FM_INTERRUPT_STATUS); | 43 | irq_status = readl(fm->addr + FM_INTERRUPT_STATUS); |
@@ -45,12 +51,12 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id) | |||
45 | 51 | ||
46 | for (cnt = 0; cnt < fm->num_sockets; cnt++) { | 52 | for (cnt = 0; cnt < fm->num_sockets; cnt++) { |
47 | sock = fm->sockets[cnt]; | 53 | sock = fm->sockets[cnt]; |
48 | sock_irq_status = (irq_status >> cnt) | 54 | if (sock) { |
49 | & (TIFM_IRQ_FIFOMASK(1) | 55 | if ((irq_status >> cnt) & TIFM_IRQ_FIFOMASK(1)) |
50 | | TIFM_IRQ_CARDMASK(1)); | 56 | sock->data_event(sock); |
51 | 57 | if ((irq_status >> cnt) & TIFM_IRQ_CARDMASK(1)) | |
52 | if (sock && sock_irq_status) | 58 | sock->card_event(sock); |
53 | sock->signal_irq(sock, sock_irq_status); | 59 | } |
54 | } | 60 | } |
55 | 61 | ||
56 | fm->socket_change_set |= irq_status | 62 | fm->socket_change_set |= irq_status |