Commit b8010790 authored by Kalle Valo's avatar Kalle Valo Committed by John W. Linville

wl1251: remove fixed address support from spi commands

The fixed addresses are not used in wl1251, only in wl1271. So it can
be safely removed.
Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5e32b1ed
...@@ -255,8 +255,7 @@ int wl1251_set_partition(struct wl1251 *wl, ...@@ -255,8 +255,7 @@ int wl1251_set_partition(struct wl1251 *wl,
return 0; return 0;
} }
void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, size_t len)
size_t len, bool fixed)
{ {
struct spi_transfer t[3]; struct spi_transfer t[3];
struct spi_message m; struct spi_message m;
...@@ -271,9 +270,6 @@ void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, ...@@ -271,9 +270,6 @@ void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf,
*cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH; *cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH;
*cmd |= addr & WSPI_CMD_BYTE_ADDR; *cmd |= addr & WSPI_CMD_BYTE_ADDR;
if (fixed)
*cmd |= WSPI_CMD_FIXED;
spi_message_init(&m); spi_message_init(&m);
memset(t, 0, sizeof(t)); memset(t, 0, sizeof(t));
...@@ -298,8 +294,7 @@ void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, ...@@ -298,8 +294,7 @@ void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf,
wl1251_dump(DEBUG_SPI, "spi_read buf <- ", buf, len); wl1251_dump(DEBUG_SPI, "spi_read buf <- ", buf, len);
} }
void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, size_t len)
size_t len, bool fixed)
{ {
struct spi_transfer t[2]; struct spi_transfer t[2];
struct spi_message m; struct spi_message m;
...@@ -312,9 +307,6 @@ void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, ...@@ -312,9 +307,6 @@ void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf,
*cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH; *cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH;
*cmd |= addr & WSPI_CMD_BYTE_ADDR; *cmd |= addr & WSPI_CMD_BYTE_ADDR;
if (fixed)
*cmd |= WSPI_CMD_FIXED;
spi_message_init(&m); spi_message_init(&m);
memset(t, 0, sizeof(t)); memset(t, 0, sizeof(t));
...@@ -339,7 +331,7 @@ void wl1251_spi_mem_read(struct wl1251 *wl, int addr, void *buf, ...@@ -339,7 +331,7 @@ void wl1251_spi_mem_read(struct wl1251 *wl, int addr, void *buf,
physical = wl1251_translate_mem_addr(wl, addr); physical = wl1251_translate_mem_addr(wl, addr);
wl1251_spi_read(wl, physical, buf, len, false); wl1251_spi_read(wl, physical, buf, len);
} }
void wl1251_spi_mem_write(struct wl1251 *wl, int addr, void *buf, void wl1251_spi_mem_write(struct wl1251 *wl, int addr, void *buf,
...@@ -349,27 +341,25 @@ void wl1251_spi_mem_write(struct wl1251 *wl, int addr, void *buf, ...@@ -349,27 +341,25 @@ void wl1251_spi_mem_write(struct wl1251 *wl, int addr, void *buf,
physical = wl1251_translate_mem_addr(wl, addr); physical = wl1251_translate_mem_addr(wl, addr);
wl1251_spi_write(wl, physical, buf, len, false); wl1251_spi_write(wl, physical, buf, len);
} }
void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len, void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len)
bool fixed)
{ {
int physical; int physical;
physical = wl1251_translate_reg_addr(wl, addr); physical = wl1251_translate_reg_addr(wl, addr);
wl1251_spi_read(wl, physical, buf, len, fixed); wl1251_spi_read(wl, physical, buf, len);
} }
void wl1251_spi_reg_write(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)
bool fixed)
{ {
int physical; int physical;
physical = wl1251_translate_reg_addr(wl, addr); physical = wl1251_translate_reg_addr(wl, addr);
wl1251_spi_write(wl, physical, buf, len, fixed); wl1251_spi_write(wl, physical, buf, len);
} }
u32 wl1251_mem_read32(struct wl1251 *wl, int addr) u32 wl1251_mem_read32(struct wl1251 *wl, int addr)
......
...@@ -71,10 +71,8 @@ ...@@ -71,10 +71,8 @@
/* Raw target IO, address is not translated */ /* Raw target IO, address is not translated */
void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, size_t len);
size_t len, bool fixed); void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, size_t len);
void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf,
size_t len, bool fixed);
/* Memory target IO, address is tranlated to partition 0 */ /* 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_read(struct wl1251 *wl, int addr, void *buf, size_t len);
...@@ -83,10 +81,8 @@ u32 wl1251_mem_read32(struct wl1251 *wl, int addr); ...@@ -83,10 +81,8 @@ u32 wl1251_mem_read32(struct wl1251 *wl, int addr);
void wl1251_mem_write32(struct wl1251 *wl, int addr, u32 val); void wl1251_mem_write32(struct wl1251 *wl, int addr, u32 val);
/* Registers IO */ /* Registers IO */
void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len, void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len);
bool fixed); void wl1251_spi_reg_write(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,
bool fixed);
u32 wl1251_reg_read32(struct wl1251 *wl, int addr); u32 wl1251_reg_read32(struct wl1251 *wl, int addr);
void wl1251_reg_write32(struct wl1251 *wl, int addr, u32 val); void wl1251_reg_write32(struct wl1251 *wl, int addr, u32 val);
...@@ -99,8 +95,7 @@ int wl1251_set_partition(struct wl1251 *wl, ...@@ -99,8 +95,7 @@ int wl1251_set_partition(struct wl1251 *wl,
static inline u32 wl1251_read32(struct wl1251 *wl, int addr) static inline u32 wl1251_read32(struct wl1251 *wl, int addr)
{ {
wl1251_spi_read(wl, addr, &wl->buffer_32, wl1251_spi_read(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
sizeof(wl->buffer_32), false);
return wl->buffer_32; return wl->buffer_32;
} }
...@@ -108,8 +103,7 @@ static inline u32 wl1251_read32(struct wl1251 *wl, int addr) ...@@ -108,8 +103,7 @@ static inline u32 wl1251_read32(struct wl1251 *wl, int addr)
static inline void wl1251_write32(struct wl1251 *wl, int addr, u32 val) static inline void wl1251_write32(struct wl1251 *wl, int addr, u32 val)
{ {
wl->buffer_32 = val; wl->buffer_32 = val;
wl1251_spi_write(wl, addr, &wl->buffer_32, wl1251_spi_write(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
sizeof(wl->buffer_32), false);
} }
#endif /* __WL1251_SPI_H__ */ #endif /* __WL1251_SPI_H__ */
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