dma: add DMA_ATTR_COPY_ALIGNMENT to dma attributes

Add DMA_ATTR_COPY_ALIGNMENT attribute in order to
retrieve the smallest possible chunk of data that can
be copied by dma.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This commit is contained in:
Bartosz Kokoszko 2019-06-25 10:26:36 +02:00 committed by Tomasz Lauda
parent 83b19454dd
commit ed1c9164f9
8 changed files with 12 additions and 0 deletions

View File

@ -1342,6 +1342,9 @@ static int dw_dma_get_attribute(struct dma *dma, uint32_t type,
case DMA_ATTR_BUFFER_ALIGNMENT:
*value = DW_DMA_BUFFER_ALIGNMENT;
break;
case DMA_ATTR_COPY_ALIGNMENT:
*value = DW_DMA_COPY_ALIGNMENT;
break;
default:
ret = -EINVAL;
break;

View File

@ -959,6 +959,9 @@ static int hda_dma_get_attribute(struct dma *dma, uint32_t type,
case DMA_ATTR_BUFFER_ALIGNMENT:
*value = PLATFORM_HDA_BUFFER_ALIGNMENT;
break;
case DMA_ATTR_COPY_ALIGNMENT:
*value = PLATFORM_HDA_COPY_ALIGNMENT;
break;
default:
ret = -EINVAL;
break;

View File

@ -81,6 +81,7 @@ enum dma_cb_status {
/* DMA attributes */
#define DMA_ATTR_BUFFER_ALIGNMENT 0
#define DMA_ATTR_COPY_ALIGNMENT 1
struct dma;

View File

@ -131,6 +131,7 @@
trace_error(TRACE_CLASS_DMA, __e, ##__VA_ARGS__)
#define DW_DMA_BUFFER_ALIGNMENT 0x20
#define DW_DMA_COPY_ALIGNMENT 0x20
/* TODO: add FIFO sizes */
struct dw_chan_data {

View File

@ -44,6 +44,7 @@ struct sof;
/* DGMBS align value */
#define PLATFORM_HDA_BUFFER_ALIGNMENT 0x20
#define PLATFORM_HDA_COPY_ALIGNMENT 0x20
/* HD-DMA single burst size */
#define PLATFORM_HDA_BURST_SIZE 32

View File

@ -54,6 +54,7 @@ struct sof;
/* DGMBS align value */
#define PLATFORM_HDA_BUFFER_ALIGNMENT 0x20
#define PLATFORM_HDA_COPY_ALIGNMENT 0x20
/* HD-DMA single burst size */
#define PLATFORM_HDA_BURST_SIZE 32

View File

@ -54,6 +54,7 @@ struct sof;
/* DGMBS align value */
#define PLATFORM_HDA_BUFFER_ALIGNMENT 0x20
#define PLATFORM_HDA_COPY_ALIGNMENT 0x20
/* HD-DMA single burst size */
#define PLATFORM_HDA_BURST_SIZE 32

View File

@ -54,6 +54,7 @@ struct sof;
/* DGMBS align value */
#define PLATFORM_HDA_BUFFER_ALIGNMENT 0x20
#define PLATFORM_HDA_COPY_ALIGNMENT 0x20
/* HD-DMA single burst size */
#define PLATFORM_HDA_BURST_SIZE 32