diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_spi.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_spi.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_spi.c b/drivers/net/wireless/wl12xx/wl1251_spi.c index 5967317ef02..7d1031b7a08 100644 --- a/drivers/net/wireless/wl12xx/wl1251_spi.c +++ b/drivers/net/wireless/wl12xx/wl1251_spi.c | |||
@@ -31,6 +31,19 @@ | |||
31 | #include "reg.h" | 31 | #include "reg.h" |
32 | #include "wl1251_spi.h" | 32 | #include "wl1251_spi.h" |
33 | 33 | ||
34 | static irqreturn_t wl1251_irq(int irq, void *cookie) | ||
35 | { | ||
36 | struct wl1251 *wl; | ||
37 | |||
38 | wl1251_debug(DEBUG_IRQ, "IRQ"); | ||
39 | |||
40 | wl = cookie; | ||
41 | |||
42 | schedule_work(&wl->irq_work); | ||
43 | |||
44 | return IRQ_HANDLED; | ||
45 | } | ||
46 | |||
34 | static struct spi_device *wl_to_spi(struct wl1251 *wl) | 47 | static struct spi_device *wl_to_spi(struct wl1251 *wl) |
35 | { | 48 | { |
36 | return wl->if_priv; | 49 | return wl->if_priv; |
@@ -193,10 +206,22 @@ static void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, | |||
193 | wl1251_dump(DEBUG_SPI, "spi_write buf -> ", buf, len); | 206 | wl1251_dump(DEBUG_SPI, "spi_write buf -> ", buf, len); |
194 | } | 207 | } |
195 | 208 | ||
209 | static void wl1251_spi_enable_irq(struct wl1251 *wl) | ||
210 | { | ||
211 | return enable_irq(wl->irq); | ||
212 | } | ||
213 | |||
214 | static void wl1251_spi_disable_irq(struct wl1251 *wl) | ||
215 | { | ||
216 | return disable_irq(wl->irq); | ||
217 | } | ||
218 | |||
196 | static const struct wl1251_if_operations wl1251_spi_ops = { | 219 | static const struct wl1251_if_operations wl1251_spi_ops = { |
197 | .read = wl1251_spi_read, | 220 | .read = wl1251_spi_read, |
198 | .write = wl1251_spi_write, | 221 | .write = wl1251_spi_write, |
199 | .reset = wl1251_spi_reset_wake, | 222 | .reset = wl1251_spi_reset_wake, |
223 | .enable_irq = wl1251_spi_enable_irq, | ||
224 | .disable_irq = wl1251_spi_disable_irq, | ||
200 | }; | 225 | }; |
201 | 226 | ||
202 | static int __devinit wl1251_spi_probe(struct spi_device *spi) | 227 | static int __devinit wl1251_spi_probe(struct spi_device *spi) |
@@ -274,6 +299,7 @@ static int __devexit wl1251_spi_remove(struct spi_device *spi) | |||
274 | { | 299 | { |
275 | struct wl1251 *wl = dev_get_drvdata(&spi->dev); | 300 | struct wl1251 *wl = dev_get_drvdata(&spi->dev); |
276 | 301 | ||
302 | free_irq(wl->irq, wl); | ||
277 | wl1251_free_hw(wl); | 303 | wl1251_free_hw(wl); |
278 | 304 | ||
279 | return 0; | 305 | return 0; |