Commit a336e266 authored by Luciano Coelho's avatar Luciano Coelho Committed by John W. Linville

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: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0628817a
...@@ -348,6 +348,24 @@ void wl12xx_spi_mem_write(struct wl12xx *wl, int addr, void *buf, ...@@ -348,6 +348,24 @@ void wl12xx_spi_mem_write(struct wl12xx *wl, int addr, void *buf,
wl12xx_spi_write(wl, physical, buf, len); wl12xx_spi_write(wl, physical, buf, len);
} }
void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len)
{
int physical;
physical = wl12xx_translate_reg_addr(wl, addr);
wl12xx_spi_read(wl, physical, buf, len);
}
void wl12xx_spi_reg_write(struct wl12xx *wl, int addr, void *buf, size_t len)
{
int physical;
physical = wl12xx_translate_reg_addr(wl, addr);
wl12xx_spi_write(wl, physical, buf, len);
}
u32 wl12xx_mem_read32(struct wl12xx *wl, int addr) u32 wl12xx_mem_read32(struct wl12xx *wl, int addr)
{ {
return wl12xx_read32(wl, wl12xx_translate_mem_addr(wl, addr)); return wl12xx_read32(wl, wl12xx_translate_mem_addr(wl, addr));
......
...@@ -81,6 +81,8 @@ u32 wl12xx_mem_read32(struct wl12xx *wl, int addr); ...@@ -81,6 +81,8 @@ u32 wl12xx_mem_read32(struct wl12xx *wl, int addr);
void wl12xx_mem_write32(struct wl12xx *wl, int addr, u32 val); void wl12xx_mem_write32(struct wl12xx *wl, int addr, u32 val);
/* Registers IO */ /* Registers IO */
void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len);
void wl12xx_spi_reg_write(struct wl12xx *wl, int addr, void *buf,size_t len);
u32 wl12xx_reg_read32(struct wl12xx *wl, int addr); u32 wl12xx_reg_read32(struct wl12xx *wl, int addr);
void wl12xx_reg_write32(struct wl12xx *wl, int addr, u32 val); void wl12xx_reg_write32(struct wl12xx *wl, int addr, u32 val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment