Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180893
b: refs/heads/master
c: c587b6f
h: refs/heads/master
i:
  180891: a2e112f
v: v3
  • Loading branch information
Feng Tang authored and Grant Likely committed Jan 21, 2010
1 parent 65fe721 commit 49c5b45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 99147b5c4167612a987860b661b9f8b79e66b81f
refs/heads/master: c587b6fa05106606053fc5e8e344f07cd34ace23
16 changes: 16 additions & 0 deletions trunk/drivers/spi/dw_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,22 @@ static void spi_hw_init(struct dw_spi *dws)
spi_mask_intr(dws, 0xff);
spi_enable_chip(dws, 1);
flush(dws);

/*
* Try to detect the FIFO depth if not set by interface driver,
* the depth could be from 2 to 256 from HW spec
*/
if (!dws->fifo_len) {
u32 fifo;
for (fifo = 2; fifo <= 257; fifo++) {
dw_writew(dws, txfltr, fifo);
if (fifo != dw_readw(dws, txfltr))
break;
}

dws->fifo_len = (fifo == 257) ? 0 : fifo;
dw_writew(dws, txfltr, 0);
}
}

int __devinit dw_spi_add_host(struct dw_spi *dws)
Expand Down

0 comments on commit 49c5b45

Please sign in to comment.