wl1251: separate bus i/o code into io.c
In order to eventually support wl1251 spi and sdio interfaces, move the register and memory transfer functions to a common file. Also rename wl1251_spi_mem_{read,write} to indicate its common usage. We still use spi_read internally until SDIO interface is introduced so nothing functional should change here. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
此提交包含在:
@@ -69,23 +69,6 @@
|
||||
((WL1251_BUSY_WORD_LEN - 4) / sizeof(u32))
|
||||
#define HW_ACCESS_WSPI_INIT_CMD_MASK 0
|
||||
|
||||
|
||||
/* Raw target IO, address is not translated */
|
||||
void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, size_t len);
|
||||
void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, size_t len);
|
||||
|
||||
/* Memory target IO, address is tranlated to partition 0 */
|
||||
void wl1251_spi_mem_read(struct wl1251 *wl, int addr, void *buf, size_t len);
|
||||
void wl1251_spi_mem_write(struct wl1251 *wl, int addr, void *buf, size_t len);
|
||||
u32 wl1251_mem_read32(struct wl1251 *wl, int addr);
|
||||
void wl1251_mem_write32(struct wl1251 *wl, int addr, u32 val);
|
||||
|
||||
/* Registers IO */
|
||||
void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len);
|
||||
void wl1251_spi_reg_write(struct wl1251 *wl, int addr, void *buf, size_t len);
|
||||
u32 wl1251_reg_read32(struct wl1251 *wl, int addr);
|
||||
void wl1251_reg_write32(struct wl1251 *wl, int addr, u32 val);
|
||||
|
||||
/* INIT and RESET words */
|
||||
void wl1251_spi_reset(struct wl1251 *wl);
|
||||
void wl1251_spi_init(struct wl1251 *wl);
|
||||
@@ -93,17 +76,4 @@ int wl1251_set_partition(struct wl1251 *wl,
|
||||
u32 part_start, u32 part_size,
|
||||
u32 reg_start, u32 reg_size);
|
||||
|
||||
static inline u32 wl1251_read32(struct wl1251 *wl, int addr)
|
||||
{
|
||||
wl1251_spi_read(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
|
||||
|
||||
return wl->buffer_32;
|
||||
}
|
||||
|
||||
static inline void wl1251_write32(struct wl1251 *wl, int addr, u32 val)
|
||||
{
|
||||
wl->buffer_32 = val;
|
||||
wl1251_spi_write(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
|
||||
}
|
||||
|
||||
#endif /* __WL1251_SPI_H__ */
|
||||
|
新增問題並參考
封鎖使用者