Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158803
b: refs/heads/master
c: 8ec8beb
h: refs/heads/master
i:
  158801: 767f1fc
  158799: 563bae2
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Jul 10, 2009
1 parent 94ae752 commit 4b9bdcd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f2ad4fb52916e58a1b75e9a30f42638655932d3
refs/heads/master: 8ec8beb28361864c82153fec5ddb82c9d636430f
12 changes: 8 additions & 4 deletions trunk/drivers/net/wireless/wl12xx/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
}

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;
Expand All @@ -314,6 +314,9 @@ void wl12xx_spi_write(struct wl12xx *wl, int addr, void *buf,
*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));

Expand Down Expand Up @@ -348,7 +351,7 @@ void wl12xx_spi_mem_write(struct wl12xx *wl, int addr, void *buf,

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,
Expand All @@ -361,13 +364,14 @@ 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)
Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/net/wireless/wl12xx/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@


/* 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);

Expand All @@ -84,7 +85,8 @@ void wl12xx_mem_write32(struct wl12xx *wl, int addr, u32 val);
/* 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);

Expand All @@ -106,7 +108,8 @@ static inline u32 wl12xx_read32(struct wl12xx *wl, int addr)
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__ */

0 comments on commit 4b9bdcd

Please sign in to comment.