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 | |
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')
-rw-r--r-- | drivers/misc/tifm_7xx1.c | 22 | ||||
-rw-r--r-- | drivers/misc/tifm_core.c | 11 |
2 files changed, 20 insertions, 13 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 |
diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c index 6b10ebe9d936..6799b9cca055 100644 --- a/drivers/misc/tifm_core.c +++ b/drivers/misc/tifm_core.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/idr.h> | 14 | #include <linux/idr.h> |
15 | 15 | ||
16 | #define DRIVER_NAME "tifm_core" | 16 | #define DRIVER_NAME "tifm_core" |
17 | #define DRIVER_VERSION "0.7" | 17 | #define DRIVER_VERSION "0.8" |
18 | 18 | ||
19 | static DEFINE_IDR(tifm_adapter_idr); | 19 | static DEFINE_IDR(tifm_adapter_idr); |
20 | static DEFINE_SPINLOCK(tifm_adapter_lock); | 20 | static DEFINE_SPINLOCK(tifm_adapter_lock); |
@@ -175,8 +175,7 @@ void tifm_free_device(struct device *dev) | |||
175 | } | 175 | } |
176 | EXPORT_SYMBOL(tifm_free_device); | 176 | EXPORT_SYMBOL(tifm_free_device); |
177 | 177 | ||
178 | static void tifm_dummy_signal_irq(struct tifm_dev *sock, | 178 | static void tifm_dummy_event(struct tifm_dev *sock) |
179 | unsigned int sock_irq_status) | ||
180 | { | 179 | { |
181 | return; | 180 | return; |
182 | } | 181 | } |
@@ -191,7 +190,8 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm) | |||
191 | dev->dev.parent = fm->dev; | 190 | dev->dev.parent = fm->dev; |
192 | dev->dev.bus = &tifm_bus_type; | 191 | dev->dev.bus = &tifm_bus_type; |
193 | dev->dev.release = tifm_free_device; | 192 | dev->dev.release = tifm_free_device; |
194 | dev->signal_irq = tifm_dummy_signal_irq; | 193 | dev->card_event = tifm_dummy_event; |
194 | dev->data_event = tifm_dummy_event; | ||
195 | } | 195 | } |
196 | return dev; | 196 | return dev; |
197 | } | 197 | } |
@@ -249,7 +249,8 @@ static int tifm_device_remove(struct device *dev) | |||
249 | struct tifm_driver *drv = fm_dev->drv; | 249 | struct tifm_driver *drv = fm_dev->drv; |
250 | 250 | ||
251 | if (drv) { | 251 | if (drv) { |
252 | fm_dev->signal_irq = tifm_dummy_signal_irq; | 252 | fm_dev->card_event = tifm_dummy_event; |
253 | fm_dev->data_event = tifm_dummy_event; | ||
253 | if (drv->remove) | 254 | if (drv->remove) |
254 | drv->remove(fm_dev); | 255 | drv->remove(fm_dev); |
255 | fm_dev->drv = NULL; | 256 | fm_dev->drv = NULL; |