dma: change dma transfer type to enum.

Change to use enum for dma transfer type.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
Keyon Jie 2018-03-07 19:04:31 +08:00 committed by Liam Girdwood
parent 3e24ac8e9f
commit 728f1ff3e3
3 changed files with 12 additions and 10 deletions

View File

@ -249,7 +249,7 @@
/* data for each DMA channel */ /* data for each DMA channel */
struct dma_chan_data { struct dma_chan_data {
uint32_t status; uint32_t status;
uint32_t direction; enum dma_copy_dir direction;
struct dw_lli2 *lli; struct dw_lli2 *lli;
struct dw_lli2 *lli_current; struct dw_lli2 *lli_current;
uint32_t desc_count; uint32_t desc_count;

View File

@ -84,7 +84,7 @@ struct hda_chan_data {
uint32_t status; uint32_t status;
uint32_t desc_count; uint32_t desc_count;
uint32_t desc_avail; uint32_t desc_avail;
uint32_t direction; enum dma_copy_dir direction;
}; };
struct dma_pdata { struct dma_pdata {

View File

@ -38,13 +38,15 @@
#include <reef/reef.h> #include <reef/reef.h>
#include <reef/wait.h> #include <reef/wait.h>
/* DMA directions */ /* types of DMA directions */
#define DMA_DIR_MEM_TO_MEM 0 /* local memcpy */ enum dma_copy_dir {
#define DMA_DIR_HMEM_TO_LMEM 1 /* host to local memcpy */ DMA_DIR_MEM_TO_MEM = 0, /* local memcpy */
#define DMA_DIR_LMEM_TO_HMEM 2 /* local to host memcpy */ DMA_DIR_HMEM_TO_LMEM, /* host to local memcpy */
#define DMA_DIR_MEM_TO_DEV 3 DMA_DIR_LMEM_TO_HMEM, /* local to host memcpy */
#define DMA_DIR_DEV_TO_MEM 4 DMA_DIR_MEM_TO_DEV,
#define DMA_DIR_DEV_TO_DEV 5 DMA_DIR_DEV_TO_MEM,
DMA_DIR_DEV_TO_DEV,
};
/* DMA IRQ types */ /* DMA IRQ types */
#define DMA_IRQ_TYPE_BLOCK (1 << 0) #define DMA_IRQ_TYPE_BLOCK (1 << 0)
@ -71,7 +73,7 @@ struct dma_sg_config {
uint32_t src_width; /* in bytes */ uint32_t src_width; /* in bytes */
uint32_t dest_width; /* in bytes */ uint32_t dest_width; /* in bytes */
uint32_t burst_elems; uint32_t burst_elems;
uint32_t direction; enum dma_copy_dir direction;
uint32_t src_dev; uint32_t src_dev;
uint32_t dest_dev; uint32_t dest_dev;
uint32_t cyclic; /* circular buffer */ uint32_t cyclic; /* circular buffer */