summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/spi.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@nokia.com>2009-06-12 15:15:41 +0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 22:57:45 +0400
commit052a625a859ceba68022862eeee70511f56483a5 (patch)
tree12650ed57e0a64230073e9730b15c220335bf1b4 /drivers/net/wireless/wl12xx/spi.c
parent27797d68f70b28e77e6d183910dc7b3d7505105d (diff)
downloadlinux-052a625a859ceba68022862eeee70511f56483a5.tar.xz
wl12xx: add support for fixed address in wl12xx_spi_read
In the wl1271 implementation, we need to read memory from the register partition using fixed addresses. This change adds the possibility to request fixed address when calling wl12xx_spi_read() or wl12xx_spi_reg_read(). Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/spi.c')
-rw-r--r--drivers/net/wireless/wl12xx/spi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c
index 0d2b13a550e6..c3d5b7378610 100644
--- a/drivers/net/wireless/wl12xx/spi.c
+++ b/drivers/net/wireless/wl12xx/spi.c
@@ -258,7 +258,7 @@ int wl12xx_set_partition(struct wl12xx *wl,
}
void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
- size_t len)
+ size_t len, bool fixed)
{
struct spi_transfer t[3];
struct spi_message m;
@@ -273,6 +273,9 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
*cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH;
*cmd |= addr & WSPI_CMD_BYTE_ADDR;
+ if (fixed)
+ *cmd |= WSPI_CMD_FIXED;
+
spi_message_init(&m);
memset(t, 0, sizeof(t));
@@ -335,7 +338,7 @@ void wl12xx_spi_mem_read(struct wl12xx *wl, int addr, void *buf,
physical = wl12xx_translate_mem_addr(wl, addr);
- wl12xx_spi_read(wl, physical, buf, len);
+ wl12xx_spi_read(wl, physical, buf, len, false);
}
void wl12xx_spi_mem_write(struct wl12xx *wl, int addr, void *buf,
@@ -348,13 +351,14 @@ void wl12xx_spi_mem_write(struct wl12xx *wl, int addr, void *buf,
wl12xx_spi_write(wl, physical, buf, len);
}
-void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len)
+void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len,
+ bool fixed)
{
int physical;
physical = wl12xx_translate_reg_addr(wl, addr);
- wl12xx_spi_read(wl, physical, buf, len);
+ wl12xx_spi_read(wl, physical, buf, len, fixed);
}
void wl12xx_spi_reg_write(struct wl12xx *wl, int addr, void *buf, size_t len)