summaryrefslogtreecommitdiffstats
path: root/drivers/dma/acpi-dma.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-08-20 15:15:37 +0200
committerVinod Koul <vkoul@kernel.org>2019-08-21 06:11:27 +0200
commita6bc332373e5176c2d085657bc643a28950b20b0 (patch)
treeda0c5a76fc16a24ef5a3821dda2894436175f510 /drivers/dma/acpi-dma.c
parentdmaengine: change alignment of mux_configure32 and fsl_edma_chan_mux (diff)
downloadlinux-a6bc332373e5176c2d085657bc643a28950b20b0.tar.xz
linux-a6bc332373e5176c2d085657bc643a28950b20b0.zip
dmaengine: acpi: Set up DMA mask based on CSRT
CSRT has an information about address width, which is supported by the certain DMA controller. Use information from CSRT to set up DMA mask for shared controller. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20190820131546.75744-2-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/acpi-dma.c')
-rw-r--r--drivers/dma/acpi-dma.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
index 30243f5c0710..4d66ee059808 100644
--- a/drivers/dma/acpi-dma.c
+++ b/drivers/dma/acpi-dma.c
@@ -10,6 +10,7 @@
*/
#include <linux/device.h>
+#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -82,6 +83,12 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
if (si->base_request_line == 0 && si->num_handshake_signals == 0)
return 0;
+ /* Set up DMA mask based on value from CSRT */
+ ret = dma_coerce_mask_and_coherent(&adev->dev,
+ DMA_BIT_MASK(si->dma_address_width));
+ if (ret)
+ return 0;
+
adma->base_request_line = si->base_request_line;
adma->end_request_line = si->base_request_line +
si->num_handshake_signals - 1;