}
void wl12xx_spi_write(struct wl12xx *wl, int addr, void *buf,
- size_t len)
+ size_t len, bool fixed)
{
struct spi_transfer t[2];
struct spi_message m;
*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));
physical = wl12xx_translate_mem_addr(wl, addr);
- wl12xx_spi_write(wl, physical, buf, len);
+ wl12xx_spi_write(wl, physical, buf, len, false);
}
void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len,
wl12xx_spi_read(wl, physical, buf, len, fixed);
}
-void wl12xx_spi_reg_write(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,
+ bool fixed)
{
int physical;
physical = wl12xx_translate_reg_addr(wl, addr);
- wl12xx_spi_write(wl, physical, buf, len);
+ wl12xx_spi_write(wl, physical, buf, len, fixed);
}
u32 wl12xx_mem_read32(struct wl12xx *wl, int addr)
/* Raw target IO, address is not translated */
-void wl12xx_spi_write(struct wl12xx *wl, int addr, void *buf, size_t len);
+void wl12xx_spi_write(struct wl12xx *wl, int addr, void *buf,
+ size_t len, bool fixed);
void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
size_t len, bool fixed);
/* Registers IO */
void wl12xx_spi_reg_read(struct wl12xx *wl, int addr, void *buf, size_t len,
bool fixed);
-void wl12xx_spi_reg_write(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,
+ bool fixed);
u32 wl12xx_reg_read32(struct wl12xx *wl, int addr);
void wl12xx_reg_write32(struct wl12xx *wl, int addr, u32 val);
static inline void wl12xx_write32(struct wl12xx *wl, int addr, u32 val)
{
wl->buffer_32 = val;
- wl12xx_spi_write(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
+ wl12xx_spi_write(wl, addr, &wl->buffer_32,
+ sizeof(wl->buffer_32), false);
}
#endif /* __WL12XX_SPI_H__ */