Skip to content

Commit d7c33cf

Browse files
wangbaolin719vinodkoul
authored andcommitted
dmaengine: sprd: Define the DMA data width type
Define the DMA data width type to make code more readable. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 6b1d255 commit d7c33cf

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎drivers/dma/sprd-dma.c‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ enum sprd_dma_int_type {
176176
SPRD_DMA_CFGERR_INT,
177177
};
178178

179+
/* dma data width values */
180+
enum sprd_dma_datawidth {
181+
SPRD_DMA_DATAWIDTH_1_BYTE,
182+
SPRD_DMA_DATAWIDTH_2_BYTES,
183+
SPRD_DMA_DATAWIDTH_4_BYTES,
184+
SPRD_DMA_DATAWIDTH_8_BYTES,
185+
};
186+
179187
/* dma channel hardware configuration */
180188
struct sprd_dma_chn_hw {
181189
u32 pause;
@@ -604,15 +612,15 @@ static int sprd_dma_config(struct dma_chan *chan, struct sprd_dma_desc *sdesc,
604612
u32 fix_mode = 0, fix_en = 0;
605613

606614
if (IS_ALIGNED(len, 4)) {
607-
datawidth = 2;
615+
datawidth = SPRD_DMA_DATAWIDTH_4_BYTES;
608616
src_step = SPRD_DMA_WORD_STEP;
609617
des_step = SPRD_DMA_WORD_STEP;
610618
} else if (IS_ALIGNED(len, 2)) {
611-
datawidth = 1;
619+
datawidth = SPRD_DMA_DATAWIDTH_2_BYTES;
612620
src_step = SPRD_DMA_SHORT_STEP;
613621
des_step = SPRD_DMA_SHORT_STEP;
614622
} else {
615-
datawidth = 0;
623+
datawidth = SPRD_DMA_DATAWIDTH_1_BYTE;
616624
src_step = SPRD_DMA_BYTE_STEP;
617625
des_step = SPRD_DMA_BYTE_STEP;
618626
}

0 commit comments

Comments
 (0)