Commit 30b4b703 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: dw: print debug message with FIFO size

When autodetection is used it would be useful to know what the FIFO size is.
The patch adds a debug message for this purpose.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3dbb3b98
...@@ -608,7 +608,7 @@ static void dw_spi_cleanup(struct spi_device *spi) ...@@ -608,7 +608,7 @@ static void dw_spi_cleanup(struct spi_device *spi)
} }
/* Restart the controller, disable all interrupts, clean rx fifo */ /* Restart the controller, disable all interrupts, clean rx fifo */
static void spi_hw_init(struct dw_spi *dws) static void spi_hw_init(struct device *dev, struct dw_spi *dws)
{ {
spi_enable_chip(dws, 0); spi_enable_chip(dws, 0);
spi_mask_intr(dws, 0xff); spi_mask_intr(dws, 0xff);
...@@ -626,9 +626,10 @@ static void spi_hw_init(struct dw_spi *dws) ...@@ -626,9 +626,10 @@ static void spi_hw_init(struct dw_spi *dws)
if (fifo != dw_readw(dws, DW_SPI_TXFLTR)) if (fifo != dw_readw(dws, DW_SPI_TXFLTR))
break; break;
} }
dw_writew(dws, DW_SPI_TXFLTR, 0);
dws->fifo_len = (fifo == 2) ? 0 : fifo - 1; dws->fifo_len = (fifo == 2) ? 0 : fifo - 1;
dw_writew(dws, DW_SPI_TXFLTR, 0); dev_dbg(dev, "Detected FIFO size: %u bytes\n", dws->fifo_len);
} }
} }
...@@ -668,7 +669,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) ...@@ -668,7 +669,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
master->dev.of_node = dev->of_node; master->dev.of_node = dev->of_node;
/* Basic HW init */ /* Basic HW init */
spi_hw_init(dws); spi_hw_init(dev, dws);
if (dws->dma_ops && dws->dma_ops->dma_init) { if (dws->dma_ops && dws->dma_ops->dma_init) {
ret = dws->dma_ops->dma_init(dws); ret = dws->dma_ops->dma_init(dws);
...@@ -731,7 +732,7 @@ int dw_spi_resume_host(struct dw_spi *dws) ...@@ -731,7 +732,7 @@ int dw_spi_resume_host(struct dw_spi *dws)
{ {
int ret; int ret;
spi_hw_init(dws); spi_hw_init(&dws->master->dev, dws);
ret = spi_master_resume(dws->master); ret = spi_master_resume(dws->master);
if (ret) if (ret)
dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret); dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);
......
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