[v1,03/12] dmaengine: acpi: Provide consumer device to ->acpi_dma_xlate()
diff mbox series

Message ID 20190806094054.64871-3-andriy.shevchenko@linux.intel.com
State Changes Requested
Headers show
Series
  • [v1,01/12] dmaengine: acpi: Set up DMA mask based on CSRT
Related show

Commit Message

Andy Shevchenko Aug. 6, 2019, 9:40 a.m. UTC
In the future ->acpi_dma_xlate() callback function may use the consumer
device pointer to be utilized for DMA crossbar programming.

As a preparation step provide consumer device pointer to ->acpi_dma_xlate().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/acpi-dma.c   | 1 +
 include/linux/acpi_dma.h | 2 ++
 2 files changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
index b17373ee7ce0..1f35239e3ca2 100644
--- a/drivers/dma/acpi-dma.c
+++ b/drivers/dma/acpi-dma.c
@@ -373,6 +373,7 @@  struct dma_chan *acpi_dma_request_slave_chan_by_index(struct device *dev,
 	memset(&pdata, 0, sizeof(pdata));
 
 	/* Initial values for the request line and channel */
+	dma_spec->consumer = dev;
 	dma_spec->index = index;
 	dma_spec->chan_id = -1;
 	dma_spec->slave_id = -1;
diff --git a/include/linux/acpi_dma.h b/include/linux/acpi_dma.h
index 2caebb8fb158..3b97d0b702af 100644
--- a/include/linux/acpi_dma.h
+++ b/include/linux/acpi_dma.h
@@ -18,6 +18,7 @@ 
 
 /**
  * struct acpi_dma_spec - slave device DMA resources
+ * @consumer:	struct device of the DMA resources consumer
  * @index:	index of FixedDMA() resource
  * @chan_id:	channel unique id
  * @slave_id:	request line unique id
@@ -25,6 +26,7 @@ 
  *		function
  */
 struct acpi_dma_spec {
+	struct device	*consumer;
 	size_t		index;
 	int		chan_id;
 	int		slave_id;