diff options
author | Christian Lütke-Stetzkamp <christian@lkamp.de> | 2018-04-18 17:27:35 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-23 15:37:49 +0200 |
commit | 6fdbd49beec3e690a715bbdd4a3f67808d5406dd (patch) | |
tree | 59815f8271a3ba823fa5d1cb89836fcb988a803e /drivers | |
parent | 4e7fd0f3e0f370158e5c5407c8995bf609778b37 (diff) |
staging: mt7621-mmc: Remove flags from msdc_dma
The flags of msdc_dma are set to a constant value, so block and dword
padding are disabled and checksum is enabled. By removing the field
the code is easier to read and the difference to the mtk-sd driver is
smaller.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/mt7621-mmc/mt6575_sd.h | 6 | ||||
-rw-r--r-- | drivers/staging/mt7621-mmc/sd.c | 16 |
2 files changed, 5 insertions, 17 deletions
diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h index 323b039a1fd2..ee796990e7c5 100644 --- a/drivers/staging/mt7621-mmc/mt6575_sd.h +++ b/drivers/staging/mt7621-mmc/mt6575_sd.h @@ -889,13 +889,7 @@ struct msdc_regs { struct msdc_eco_ver_reg eco_ver; /* base+0x104h */ }; -#define DMA_FLAG_NONE (0x00000000) -#define DMA_FLAG_EN_CHKSUM (0x00000001) -#define DMA_FLAG_PAD_BLOCK (0x00000002) -#define DMA_FLAG_PAD_DWORD (0x00000004) - struct msdc_dma { - u32 flags; /* flags */ u32 xfersz; /* xfer size in bytes */ u32 sglen; /* size of scatter list */ struct scatterlist *sg; /* I/O scatter list */ diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index f382799e7229..2e63fb7ba66d 100644 --- a/drivers/staging/mt7621-mmc/sd.c +++ b/drivers/staging/mt7621-mmc/sd.c @@ -1253,7 +1253,6 @@ static int msdc_dma_config(struct msdc_host *host, struct msdc_dma *dma) u32 base = host->base; //u32 i, j, num, bdlen, arg, xfersz; u32 j, num; - u8 blkpad, dwpad, chksum; struct scatterlist *sg = dma->sg; struct gpd *gpd; struct bd *bd; @@ -1276,9 +1275,6 @@ static int msdc_dma_config(struct msdc_host *host, struct msdc_dma *dma) sdr_set_field(MSDC_DMA_CTRL, MSDC_DMA_CTRL_MODE, 0); break; case MSDC_MODE_DMA_DESC: - blkpad = (dma->flags & DMA_FLAG_PAD_BLOCK) ? 1 : 0; - dwpad = (dma->flags & DMA_FLAG_PAD_DWORD) ? 1 : 0; - chksum = (dma->flags & DMA_FLAG_EN_CHKSUM) ? 1 : 0; /* calculate the required number of gpd */ num = (dma->sglen + MAX_BD_PER_GPD - 1) / MAX_BD_PER_GPD; @@ -1292,12 +1288,12 @@ static int msdc_dma_config(struct msdc_host *host, struct msdc_dma *dma) gpd->hwo = 1; /* hw will clear it */ gpd->bdp = 1; gpd->chksum = 0; /* need to clear first. */ - gpd->chksum = (chksum ? msdc_dma_calcs((u8 *)gpd, 16) : 0); + gpd->chksum = msdc_dma_calcs((u8 *)gpd, 16); /* modify bd*/ for_each_sg(dma->sg, sg, dma->sglen, j) { - bd[j].blkpad = blkpad; - bd[j].dwpad = dwpad; + bd[j].blkpad = 0; + bd[j].dwpad = 0; bd[j].ptr = (void *)sg_dma_address(sg); bd[j].buflen = sg_dma_len(sg); @@ -1307,10 +1303,10 @@ static int msdc_dma_config(struct msdc_host *host, struct msdc_dma *dma) bd[j].eol = 0; bd[j].chksum = 0; /* checksume need to clear first */ - bd[j].chksum = (chksum ? msdc_dma_calcs((u8 *)(&bd[j]), 16) : 0); + bd[j].chksum = msdc_dma_calcs((u8 *)(&bd[j]), 16); } - sdr_set_field(MSDC_DMA_CFG, MSDC_DMA_CFG_DECSEN, chksum); + sdr_set_field(MSDC_DMA_CFG, MSDC_DMA_CFG_DECSEN, 1); sdr_set_field(MSDC_DMA_CTRL, MSDC_DMA_CTRL_BRUSTSZ, MSDC_BRUST_64B); sdr_set_field(MSDC_DMA_CTRL, MSDC_DMA_CTRL_MODE, 1); @@ -1335,8 +1331,6 @@ static void msdc_dma_setup(struct msdc_host *host, struct msdc_dma *dma, BUG_ON(sglen > MAX_BD_NUM); /* not support currently */ dma->sg = sg; - dma->flags = DMA_FLAG_EN_CHKSUM; - //dma->flags = DMA_FLAG_NONE; /* CHECKME */ dma->sglen = sglen; dma->xfersz = host->xfer_size; |