diff options
author | Luciano Coelho <luciano.coelho@nokia.com> | 2009-06-12 07:15:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 14:57:45 -0400 |
commit | a336e266640cd9f7be96b14ff09bbb37dfa646de (patch) | |
tree | 4640c8d77eb387dbb2306577e5c09c50e96afea5 /drivers | |
parent | 0628817accc305201fc0e1b7f020dec618c868cc (diff) |
wl12xx: add wl12xx_spi_reg_read() and wl12xx_spi_reg_write() functions
In some cases we need to read more than 32 bits from the register area.
These functions were added to support that, like the existing
wl12xx_spi_mem_read() and wl12xx_spi_mem_write() already do for large blocks
in the memory area.
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')
-rw-r--r-- | drivers/net/wireless/wl12xx/spi.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/spi.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c index bcdcfbca77b3..0d2b13a550e6 100644 --- a/drivers/net/wireless/wl12xx/spi.c +++ b/drivers/net/wireless/wl12xx/spi.c | |||
@@ -348,6 +348,24 @@ void wl12xx_spi_mem_write(struct wl12xx *wl, int addr, void *buf, | |||
348 | wl12xx_spi_write(wl, physical, buf, len); | 348 | wl12xx_spi_write(wl, physical, buf, len); |
349 | } | 349 | } |
350 | 350 | ||
351 | void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len) | ||
352 | { | ||
353 | int physical; | ||
354 | |||
355 | physical = wl12xx_translate_reg_addr(wl, addr); | ||
356 | |||
357 | wl12xx_spi_read(wl, physical, buf, len); | ||
358 | } | ||
359 | |||
360 | void wl12xx_spi_reg_write(struct wl12xx *wl, int addr, void *buf, size_t len) | ||
361 | { | ||
362 | int physical; | ||
363 | |||
364 | physical = wl12xx_translate_reg_addr(wl, addr); | ||
365 | |||
366 | wl12xx_spi_write(wl, physical, buf, len); | ||
367 | } | ||
368 | |||
351 | u32 wl12xx_mem_read32(struct wl12xx *wl, int addr) | 369 | u32 wl12xx_mem_read32(struct wl12xx *wl, int addr) |
352 | { | 370 | { |
353 | return wl12xx_read32(wl, wl12xx_translate_mem_addr(wl, addr)); | 371 | return wl12xx_read32(wl, wl12xx_translate_mem_addr(wl, addr)); |
diff --git a/drivers/net/wireless/wl12xx/spi.h b/drivers/net/wireless/wl12xx/spi.h index 1a19557b0b42..0996e48af9f9 100644 --- a/drivers/net/wireless/wl12xx/spi.h +++ b/drivers/net/wireless/wl12xx/spi.h | |||
@@ -81,6 +81,8 @@ u32 wl12xx_mem_read32(struct wl12xx *wl, int addr); | |||
81 | void wl12xx_mem_write32(struct wl12xx *wl, int addr, u32 val); | 81 | void wl12xx_mem_write32(struct wl12xx *wl, int addr, u32 val); |
82 | 82 | ||
83 | /* Registers IO */ | 83 | /* Registers IO */ |
84 | void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len); | ||
85 | void wl12xx_spi_reg_write(struct wl12xx *wl, int addr, void *buf,size_t len); | ||
84 | u32 wl12xx_reg_read32(struct wl12xx *wl, int addr); | 86 | u32 wl12xx_reg_read32(struct wl12xx *wl, int addr); |
85 | void wl12xx_reg_write32(struct wl12xx *wl, int addr, u32 val); | 87 | void wl12xx_reg_write32(struct wl12xx *wl, int addr, u32 val); |
86 | 88 | ||