* [PATCH v2 1/2] spi: dw: amend warning message @ 2015-01-07 14:56 Andy Shevchenko [not found] ` <1420642615-8986-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Andy Shevchenko @ 2015-01-07 14:56 UTC (permalink / raw) To: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA; +Cc: Andy Shevchenko In case of warning message in ->probe() we have to use HW device name instead of master because last is not defined yet. Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> --- drivers/spi/spi-dw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 1a0f266..8edcd1b 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -673,7 +673,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) if (dws->dma_ops && dws->dma_ops->dma_init) { ret = dws->dma_ops->dma_init(dws); if (ret) { - dev_warn(&master->dev, "DMA init failed\n"); + dev_warn(dev, "DMA init failed\n"); dws->dma_inited = 0; } } -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1420642615-8986-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* [PATCH v2 2/2] spi: dw: print debug message with FIFO size [not found] ` <1420642615-8986-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> @ 2015-01-07 14:56 ` Andy Shevchenko [not found] ` <1420642615-8986-2-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2015-01-07 18:01 ` [PATCH v2 1/2] spi: dw: amend warning message Mark Brown 1 sibling, 1 reply; 4+ messages in thread From: Andy Shevchenko @ 2015-01-07 14:56 UTC (permalink / raw) To: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA; +Cc: Andy Shevchenko 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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> --- drivers/spi/spi-dw.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 8edcd1b..5a97a62 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) } /* 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_mask_intr(dws, 0xff); @@ -626,9 +626,10 @@ static void spi_hw_init(struct dw_spi *dws) if (fifo != dw_readw(dws, DW_SPI_TXFLTR)) break; } + dw_writew(dws, DW_SPI_TXFLTR, 0); 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) master->dev.of_node = dev->of_node; /* Basic HW init */ - spi_hw_init(dws); + spi_hw_init(dev, dws); if (dws->dma_ops && dws->dma_ops->dma_init) { ret = dws->dma_ops->dma_init(dws); @@ -731,7 +732,7 @@ int dw_spi_resume_host(struct dw_spi *dws) { int ret; - spi_hw_init(dws); + spi_hw_init(&dws->master->dev, dws); ret = spi_master_resume(dws->master); if (ret) dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret); -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1420642615-8986-2-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* Re: [PATCH v2 2/2] spi: dw: print debug message with FIFO size [not found] ` <1420642615-8986-2-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> @ 2015-01-07 18:01 ` Mark Brown 0 siblings, 0 replies; 4+ messages in thread From: Mark Brown @ 2015-01-07 18:01 UTC (permalink / raw) To: Andy Shevchenko; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 213 bytes --] On Wed, Jan 07, 2015 at 04:56:55PM +0200, Andy Shevchenko wrote: > When autodetection is used it would be useful to know what the FIFO size is. > The patch adds a debug message for this purpose. Applied, thanks. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/2] spi: dw: amend warning message [not found] ` <1420642615-8986-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2015-01-07 14:56 ` [PATCH v2 2/2] spi: dw: print debug message with FIFO size Andy Shevchenko @ 2015-01-07 18:01 ` Mark Brown 1 sibling, 0 replies; 4+ messages in thread From: Mark Brown @ 2015-01-07 18:01 UTC (permalink / raw) To: Andy Shevchenko; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 213 bytes --] On Wed, Jan 07, 2015 at 04:56:54PM +0200, Andy Shevchenko wrote: > In case of warning message in ->probe() we have to use HW device name instead > of master because last is not defined yet. Applied both, thanks. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-07 18:01 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-01-07 14:56 [PATCH v2 1/2] spi: dw: amend warning message Andy Shevchenko [not found] ` <1420642615-8986-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2015-01-07 14:56 ` [PATCH v2 2/2] spi: dw: print debug message with FIFO size Andy Shevchenko [not found] ` <1420642615-8986-2-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2015-01-07 18:01 ` Mark Brown 2015-01-07 18:01 ` [PATCH v2 1/2] spi: dw: amend warning message Mark Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).