summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_io.c
diff options
context:
space:
mode:
authorTeemu Paasikivi2010-02-22 07:38:23 +0100
committerJohn W. Linville2010-03-09 21:02:57 +0100
commit8197b7118add28f9aaa99c1fb73c0e201c8cde52 (patch)
treece6c7c4cb5cdb8113b19d17b98d04929eef5030e /drivers/net/wireless/wl12xx/wl1271_io.c
parentwl1271: Added functions to enable/disable interrupt handling (diff)
downloadkernel-qcow2-linux-8197b7118add28f9aaa99c1fb73c0e201c8cde52.tar.gz
kernel-qcow2-linux-8197b7118add28f9aaa99c1fb73c0e201c8cde52.tar.xz
kernel-qcow2-linux-8197b7118add28f9aaa99c1fb73c0e201c8cde52.zip
wl1271: Implemented abstraction of IO functions.
Changed the driver to use if_ops structure to abstract access to the IO layer (SPI or SDIO). Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_io.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_io.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_io.c b/drivers/net/wireless/wl12xx/wl1271_io.c
index b825cfa30ecf..d00f7ed7f21c 100644
--- a/drivers/net/wireless/wl12xx/wl1271_io.c
+++ b/drivers/net/wireless/wl12xx/wl1271_io.c
@@ -31,14 +31,19 @@
#include "wl1271_spi.h"
#include "wl1271_io.h"
+struct device *wl1271_wl_to_dev(struct wl1271 *wl)
+{
+ return wl->if_ops->dev(wl);
+}
+
void wl1271_disable_interrupts(struct wl1271 *wl)
{
- wl1271_spi_disable_interrupts(wl);
+ wl->if_ops->disable_irq(wl);
}
void wl1271_enable_interrupts(struct wl1271 *wl)
{
- wl1271_spi_enable_interrupts(wl);
+ wl->if_ops->enable_irq(wl);
}
static int wl1271_translate_addr(struct wl1271 *wl, int addr)
@@ -127,24 +132,24 @@ int wl1271_set_partition(struct wl1271 *wl,
void wl1271_io_reset(struct wl1271 *wl)
{
- wl1271_spi_reset(wl);
+ wl->if_ops->reset(wl);
}
void wl1271_io_init(struct wl1271 *wl)
{
- wl1271_spi_init(wl);
+ wl->if_ops->init(wl);
}
void wl1271_raw_write(struct wl1271 *wl, int addr, void *buf,
size_t len, bool fixed)
{
- wl1271_spi_raw_write(wl, addr, buf, len, fixed);
+ wl->if_ops->write(wl, addr, buf, len, fixed);
}
void wl1271_raw_read(struct wl1271 *wl, int addr, void *buf,
size_t len, bool fixed)
{
- wl1271_spi_raw_read(wl, addr, buf, len, fixed);
+ wl->if_ops->read(wl, addr, buf, len, fixed);
}
void wl1271_read(struct wl1271 *wl, int addr, void *buf, size_t len,
@@ -154,7 +159,7 @@ void wl1271_read(struct wl1271 *wl, int addr, void *buf, size_t len,
physical = wl1271_translate_addr(wl, addr);
- wl1271_spi_raw_read(wl, physical, buf, len, fixed);
+ wl1271_raw_read(wl, physical, buf, len, fixed);
}
void wl1271_write(struct wl1271 *wl, int addr, void *buf, size_t len,
@@ -164,7 +169,7 @@ void wl1271_write(struct wl1271 *wl, int addr, void *buf, size_t len,
physical = wl1271_translate_addr(wl, addr);
- wl1271_spi_raw_write(wl, physical, buf, len, fixed);
+ wl1271_raw_write(wl, physical, buf, len, fixed);
}
u32 wl1271_read32(struct wl1271 *wl, int addr)