Commit 603cc270 authored by Tom Burdick's avatar Tom Burdick Committed by Carles Cufi
Browse files

dma: Add max block count attribute



Adds an attribute that describes the maximum number of scatter gather
blocks that the DMA will accept. Useful in cases where DMA is used as
the abstraction for moving data around (e.g. SoF audio streams) and
variances of the hardware need to inform decisions about how to use
the DMA API.

Co-authored-by: default avatarAdrian Bonislawski <adrian.bonislawski@intel.com>
Co-authored-by: default avatarJaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: default avatarTom Burdick <thomas.burdick@intel.com>
parent 17d3f3a5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -292,6 +292,9 @@ int intel_adsp_gpdma_get_attribute(const struct device *dev, uint32_t type, uint
	case DMA_ATTR_COPY_ALIGNMENT:
		*value = DMA_COPY_ALIGNMENT(DT_COMPAT_GET_ANY_STATUS_OKAY(intel_adsp_gpdma));
		break;
	case DMA_ATTR_MAX_BLOCK_COUNT:
		*value = CONFIG_DMA_DW_LLI_POOL_SIZE;
		break;
	default:
		return -EINVAL;
	}
+3 −0
Original line number Diff line number Diff line
@@ -280,6 +280,9 @@ int intel_adsp_hda_dma_get_attribute(const struct device *dev, uint32_t type, ui
	case DMA_ATTR_COPY_ALIGNMENT:
		*value = DMA_COPY_ALIGNMENT(DT_COMPAT_GET_ANY_STATUS_OKAY(intel_adsp_hda_link_out));
		break;
	case DMA_ATTR_MAX_BLOCK_COUNT:
		*value = 1;
		break;
	default:
		return -EINVAL;
	}
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ enum dma_attribute_type {
	DMA_ATTR_BUFFER_ADDRESS_ALIGNMENT,
	DMA_ATTR_BUFFER_SIZE_ALIGNMENT,
	DMA_ATTR_COPY_ALIGNMENT,
	DMA_ATTR_MAX_BLOCK_COUNT,
};

/**