All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: pl022: Add OF binding to disable DMA usage
@ 2018-07-24 11:27 Alexander Sverdlin
  2018-07-25 17:06 ` Mark Brown
  2018-07-31 21:53 ` Rob Herring
  0 siblings, 2 replies; 7+ messages in thread
From: Alexander Sverdlin @ 2018-07-24 11:27 UTC (permalink / raw)
  To: linux-spi, devicetree
  Cc: Alexander Sverdlin, Mark Brown, Rob Herring, Mark Rutland

Legacy platform instantiation of PL022 had an ability to configure DMA
usage on controller level. If PL022 is being instantiated from DT it still
claims couple of DMA channels capable of DMA_SLAVE unconditionally even if
there are no DMA channels specified in the DT.

Depending on the slave devices' configuration this might be waste of DMA
channels or this might even claim some precious DMA channels if there are
only few of them in the system.

Add a new boolean property to disable DMA usage on the controller level:
	"pl022,dma-disable"

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
 Documentation/devicetree/bindings/spi/spi_pl022.txt | 1 +
 drivers/spi/spi-pl022.c                             | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/spi/spi_pl022.txt b/Documentation/devicetree/bindings/spi/spi_pl022.txt
index 7638b4968ddb..d877a0871a11 100644
--- a/Documentation/devicetree/bindings/spi/spi_pl022.txt
+++ b/Documentation/devicetree/bindings/spi/spi_pl022.txt
@@ -21,6 +21,7 @@ Optional properties:
 - dma-names: Names for the dma channels, if present. There must be at
 	     least one channel named "tx" for transmit and named "rx" for
              receive.
+- pl022,dma-disable : disable DMA usage
 
 
 SPI slave nodes must be children of the SPI master node and can
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 1af8c96b940e..43039c7428fe 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2086,7 +2086,7 @@ pl022_platform_data_dt_get(struct device *dev)
 		return NULL;
 
 	pd->bus_id = -1;
-	pd->enable_dma = 1;
+	pd->enable_dma = !of_property_read_bool(np, "pl022,dma-disable");
 	of_property_read_u32(np, "num-cs", &tmp);
 	pd->num_chipselect = tmp;
 	of_property_read_u32(np, "pl022,autosuspend-delay",
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-02 11:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24 11:27 [PATCH] spi: pl022: Add OF binding to disable DMA usage Alexander Sverdlin
2018-07-25 17:06 ` Mark Brown
2018-07-26  9:04   ` Alexander Sverdlin
2018-08-01 10:39     ` Mark Brown
2018-08-01 10:47       ` Alexander Sverdlin
2018-08-02 11:45         ` Mark Brown
2018-07-31 21:53 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.