Commit a6bc3323 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20190820131546.75744-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent d071fd29
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment