Message ID | 1424857176-4711-1-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 9d239d353c319f9ff884c287ce47feb7cdf60ddc |
Headers | show |
On Wed, Feb 25, 2015 at 11:39:36AM +0200, Andy Shevchenko wrote: > The commit d297933cc7fc (spi: dw: Fix detecting FIFO depth) tries to fix the > logic of the FIFO detection based on the description on the comments. However, > there is a slight difference between numbers in TX Level and TX FIFO size. Applied, thanks.
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 0257dd1..bf3b7bc 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -494,14 +494,14 @@ static void spi_hw_init(struct device *dev, struct dw_spi *dws) if (!dws->fifo_len) { u32 fifo; - for (fifo = 2; fifo <= 256; fifo++) { + for (fifo = 1; fifo < 256; fifo++) { dw_writew(dws, DW_SPI_TXFLTR, fifo); if (fifo != dw_readw(dws, DW_SPI_TXFLTR)) break; } dw_writew(dws, DW_SPI_TXFLTR, 0); - dws->fifo_len = (fifo == 2) ? 0 : fifo - 1; + dws->fifo_len = (fifo == 1) ? 0 : fifo; dev_dbg(dev, "Detected FIFO size: %u bytes\n", dws->fifo_len); } }