aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@nokia.com>2009-08-07 06:32:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:36 -0400
commitb8010790c480f495520fd458197f86d758f0c83a (patch)
treeed0cd31b52db0a307e6cba22dc132dc9f80b8d82 /drivers
parent5e32b1ed7e81558b09bf0a6bf9e73c34db3c337c (diff)
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: 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/wl1251_spi.c26
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_spi.h18
2 files changed, 14 insertions, 30 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_spi.c b/drivers/net/wireless/wl12xx/wl1251_spi.c
index c5da79dbc49c..c2b813f51846 100644
--- a/drivers/net/wireless/wl12xx/wl1251_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1251_spi.c
@@ -255,8 +255,7 @@ int wl1251_set_partition(struct wl1251 *wl,
255 return 0; 255 return 0;
256} 256}
257 257
258void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, 258void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, size_t len)
259 size_t len, bool fixed)
260{ 259{
261 struct spi_transfer t[3]; 260 struct spi_transfer t[3];
262 struct spi_message m; 261 struct spi_message m;
@@ -271,9 +270,6 @@ void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf,
271 *cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH; 270 *cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH;
272 *cmd |= addr & WSPI_CMD_BYTE_ADDR; 271 *cmd |= addr & WSPI_CMD_BYTE_ADDR;
273 272
274 if (fixed)
275 *cmd |= WSPI_CMD_FIXED;
276
277 spi_message_init(&m); 273 spi_message_init(&m);
278 memset(t, 0, sizeof(t)); 274 memset(t, 0, sizeof(t));
279 275
@@ -298,8 +294,7 @@ void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf,
298 wl1251_dump(DEBUG_SPI, "spi_read buf <- ", buf, len); 294 wl1251_dump(DEBUG_SPI, "spi_read buf <- ", buf, len);
299} 295}
300 296
301void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, 297void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, size_t len)
302 size_t len, bool fixed)
303{ 298{
304 struct spi_transfer t[2]; 299 struct spi_transfer t[2];
305 struct spi_message m; 300 struct spi_message m;
@@ -312,9 +307,6 @@ void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf,
312 *cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH; 307 *cmd |= (len << WSPI_CMD_BYTE_LENGTH_OFFSET) & WSPI_CMD_BYTE_LENGTH;
313 *cmd |= addr & WSPI_CMD_BYTE_ADDR; 308 *cmd |= addr & WSPI_CMD_BYTE_ADDR;
314 309
315 if (fixed)
316 *cmd |= WSPI_CMD_FIXED;
317
318 spi_message_init(&m); 310 spi_message_init(&m);
319 memset(t, 0, sizeof(t)); 311 memset(t, 0, sizeof(t));
320 312
@@ -339,7 +331,7 @@ void wl1251_spi_mem_read(struct wl1251 *wl, int addr, void *buf,
339 331
340 physical = wl1251_translate_mem_addr(wl, addr); 332 physical = wl1251_translate_mem_addr(wl, addr);
341 333
342 wl1251_spi_read(wl, physical, buf, len, false); 334 wl1251_spi_read(wl, physical, buf, len);
343} 335}
344 336
345void wl1251_spi_mem_write(struct wl1251 *wl, int addr, void *buf, 337void 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 341
350 physical = wl1251_translate_mem_addr(wl, addr); 342 physical = wl1251_translate_mem_addr(wl, addr);
351 343
352 wl1251_spi_write(wl, physical, buf, len, false); 344 wl1251_spi_write(wl, physical, buf, len);
353} 345}
354 346
355void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len, 347void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len)
356 bool fixed)
357{ 348{
358 int physical; 349 int physical;
359 350
360 physical = wl1251_translate_reg_addr(wl, addr); 351 physical = wl1251_translate_reg_addr(wl, addr);
361 352
362 wl1251_spi_read(wl, physical, buf, len, fixed); 353 wl1251_spi_read(wl, physical, buf, len);
363} 354}
364 355
365void wl1251_spi_reg_write(struct wl1251 *wl, int addr, void *buf, size_t len, 356void wl1251_spi_reg_write(struct wl1251 *wl, int addr, void *buf, size_t len)
366 bool fixed)
367{ 357{
368 int physical; 358 int physical;
369 359
370 physical = wl1251_translate_reg_addr(wl, addr); 360 physical = wl1251_translate_reg_addr(wl, addr);
371 361
372 wl1251_spi_write(wl, physical, buf, len, fixed); 362 wl1251_spi_write(wl, physical, buf, len);
373} 363}
374 364
375u32 wl1251_mem_read32(struct wl1251 *wl, int addr) 365u32 wl1251_mem_read32(struct wl1251 *wl, int addr)
diff --git a/drivers/net/wireless/wl12xx/wl1251_spi.h b/drivers/net/wireless/wl12xx/wl1251_spi.h
index 6e8daf4e1085..70763528db27 100644
--- a/drivers/net/wireless/wl12xx/wl1251_spi.h
+++ b/drivers/net/wireless/wl12xx/wl1251_spi.h
@@ -71,10 +71,8 @@
71 71
72 72
73/* Raw target IO, address is not translated */ 73/* Raw target IO, address is not translated */
74void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, 74void wl1251_spi_write(struct wl1251 *wl, int addr, void *buf, size_t len);
75 size_t len, bool fixed); 75void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf, size_t len);
76void wl1251_spi_read(struct wl1251 *wl, int addr, void *buf,
77 size_t len, bool fixed);
78 76
79/* Memory target IO, address is tranlated to partition 0 */ 77/* Memory target IO, address is tranlated to partition 0 */
80void wl1251_spi_mem_read(struct wl1251 *wl, int addr, void *buf, size_t len); 78void 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);
83void wl1251_mem_write32(struct wl1251 *wl, int addr, u32 val); 81void wl1251_mem_write32(struct wl1251 *wl, int addr, u32 val);
84 82
85/* Registers IO */ 83/* Registers IO */
86void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len, 84void wl1251_spi_reg_read(struct wl1251 *wl, int addr, void *buf, size_t len);
87 bool fixed); 85void wl1251_spi_reg_write(struct wl1251 *wl, int addr, void *buf, size_t len);
88void wl1251_spi_reg_write(struct wl1251 *wl, int addr, void *buf, size_t len,
89 bool fixed);
90u32 wl1251_reg_read32(struct wl1251 *wl, int addr); 86u32 wl1251_reg_read32(struct wl1251 *wl, int addr);
91void wl1251_reg_write32(struct wl1251 *wl, int addr, u32 val); 87void wl1251_reg_write32(struct wl1251 *wl, int addr, u32 val);
92 88
@@ -99,8 +95,7 @@ int wl1251_set_partition(struct wl1251 *wl,
99 95
100static inline u32 wl1251_read32(struct wl1251 *wl, int addr) 96static inline u32 wl1251_read32(struct wl1251 *wl, int addr)
101{ 97{
102 wl1251_spi_read(wl, addr, &wl->buffer_32, 98 wl1251_spi_read(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
103 sizeof(wl->buffer_32), false);
104 99
105 return wl->buffer_32; 100 return wl->buffer_32;
106} 101}
@@ -108,8 +103,7 @@ static inline u32 wl1251_read32(struct wl1251 *wl, int addr)
108static inline void wl1251_write32(struct wl1251 *wl, int addr, u32 val) 103static inline void wl1251_write32(struct wl1251 *wl, int addr, u32 val)
109{ 104{
110 wl->buffer_32 = val; 105 wl->buffer_32 = val;
111 wl1251_spi_write(wl, addr, &wl->buffer_32, 106 wl1251_spi_write(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
112 sizeof(wl->buffer_32), false);
113} 107}
114 108
115#endif /* __WL1251_SPI_H__ */ 109#endif /* __WL1251_SPI_H__ */