From 9bb0b6dba2922c69916a810e5d599e7a0753ee70 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Thu, 1 Sep 2022 13:31:48 +0200 Subject: [PATCH] dma: gpdma: fix llp config This will setup llp config properly with dma_slot Signed-off-by: Adrian Bonislawski --- drivers/dma/dma_intel_adsp_gpdma.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/dma/dma_intel_adsp_gpdma.c b/drivers/dma/dma_intel_adsp_gpdma.c index 474c5a9093e879..b897beaf820173 100644 --- a/drivers/dma/dma_intel_adsp_gpdma.c +++ b/drivers/dma/dma_intel_adsp_gpdma.c @@ -47,13 +47,13 @@ struct intel_adsp_gpdma_cfg { }; static void intel_adsp_gpdma_llp_config(const struct device *dev, - uint32_t channel, uint32_t addr) + uint32_t channel, uint32_t dma_slot) { #ifdef CONFIG_DMA_INTEL_ADSP_GPDMA_HAS_LLP const struct intel_adsp_gpdma_cfg *const dev_cfg = dev->config; dw_write(dev_cfg->shim, GPDMA_CHLLPC_OFFSET(channel), - GPDMA_CHLLPC_DHRS(addr)); + GPDMA_CHLLPC_DHRS(dma_slot)); #endif } @@ -107,21 +107,13 @@ static int intel_adsp_gpdma_config(const struct device *dev, uint32_t channel, return res; } - struct dma_block_config *block_cfg = cfg->head_block; - /* Assume all scatter/gathers are for the same device? */ switch (cfg->channel_direction) { case MEMORY_TO_PERIPHERAL: - LOG_DBG("%s: dma %s configuring llp for destination %x", - __func__, dev->name, block_cfg->dest_address); - intel_adsp_gpdma_llp_config(dev, channel, - block_cfg->dest_address); - break; case PERIPHERAL_TO_MEMORY: - LOG_DBG("%s: dma %s configuring llp for source %x", - __func__, dev->name, block_cfg->source_address); - intel_adsp_gpdma_llp_config(dev, channel, - block_cfg->source_address); + LOG_DBG("%s: dma %s configuring llp for %x", + __func__, dev->name, cfg->dma_slot); + intel_adsp_gpdma_llp_config(dev, channel, cfg->dma_slot); break; default: break;