aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-dw.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-01-07 09:56:55 -0500
committerMark Brown <broonie@kernel.org>2015-01-07 13:01:06 -0500
commit30b4b703a5d5aa9977f5ad3aba3d77b6b8d0d255 (patch)
tree698c9525ae87d12d4a5b84c1231d322bf4e757c8 /drivers/spi/spi-dw.c
parent3dbb3b98e854bceed38fbde930fb8cf8701def73 (diff)
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dw.c')
-rw-r--r--drivers/spi/spi-dw.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 8edcd1b84562..5a97a62b298a 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -608,7 +608,7 @@ static void dw_spi_cleanup(struct spi_device *spi)
608} 608}
609 609
610/* Restart the controller, disable all interrupts, clean rx fifo */ 610/* Restart the controller, disable all interrupts, clean rx fifo */
611static void spi_hw_init(struct dw_spi *dws) 611static void spi_hw_init(struct device *dev, struct dw_spi *dws)
612{ 612{
613 spi_enable_chip(dws, 0); 613 spi_enable_chip(dws, 0);
614 spi_mask_intr(dws, 0xff); 614 spi_mask_intr(dws, 0xff);
@@ -626,9 +626,10 @@ static void spi_hw_init(struct dw_spi *dws)
626 if (fifo != dw_readw(dws, DW_SPI_TXFLTR)) 626 if (fifo != dw_readw(dws, DW_SPI_TXFLTR))
627 break; 627 break;
628 } 628 }
629 dw_writew(dws, DW_SPI_TXFLTR, 0);
629 630
630 dws->fifo_len = (fifo == 2) ? 0 : fifo - 1; 631 dws->fifo_len = (fifo == 2) ? 0 : fifo - 1;
631 dw_writew(dws, DW_SPI_TXFLTR, 0); 632 dev_dbg(dev, "Detected FIFO size: %u bytes\n", dws->fifo_len);
632 } 633 }
633} 634}
634 635
@@ -668,7 +669,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
668 master->dev.of_node = dev->of_node; 669 master->dev.of_node = dev->of_node;
669 670
670 /* Basic HW init */ 671 /* Basic HW init */
671 spi_hw_init(dws); 672 spi_hw_init(dev, dws);
672 673
673 if (dws->dma_ops && dws->dma_ops->dma_init) { 674 if (dws->dma_ops && dws->dma_ops->dma_init) {
674 ret = dws->dma_ops->dma_init(dws); 675 ret = dws->dma_ops->dma_init(dws);
@@ -731,7 +732,7 @@ int dw_spi_resume_host(struct dw_spi *dws)
731{ 732{
732 int ret; 733 int ret;
733 734
734 spi_hw_init(dws); 735 spi_hw_init(&dws->master->dev, dws);
735 ret = spi_master_resume(dws->master); 736 ret = spi_master_resume(dws->master);
736 if (ret) 737 if (ret)
737 dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret); 738 dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);