drivers: i2s: fix block size for DMA interface
`block_count` in `dma_cfg` is described as how many bytes to be transfered in dma.h. So it should be 2 since the source data size and dest data size are all 16 bits in this application. And all block size should represent just bytes. Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
This commit is contained in:
parent
c086597e21
commit
ee5104cd62
1 changed files with 3 additions and 4 deletions
|
@ -428,8 +428,7 @@ static int reload_dma(struct device *dev_dma, u32_t channel,
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = dma_reload(dev_dma, channel, (u32_t)src, (u32_t)dst,
|
ret = dma_reload(dev_dma, channel, (u32_t)src, (u32_t)dst, blk_size);
|
||||||
blk_size / sizeof(u16_t));
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -449,7 +448,7 @@ static int start_dma(struct device *dev_dma, u32_t channel,
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
memset(&blk_cfg, 0, sizeof(blk_cfg));
|
memset(&blk_cfg, 0, sizeof(blk_cfg));
|
||||||
blk_cfg.block_size = blk_size / sizeof(u16_t);
|
blk_cfg.block_size = blk_size;
|
||||||
blk_cfg.source_address = (u32_t)src;
|
blk_cfg.source_address = (u32_t)src;
|
||||||
blk_cfg.dest_address = (u32_t)dst;
|
blk_cfg.dest_address = (u32_t)dst;
|
||||||
if (src_addr_increment) {
|
if (src_addr_increment) {
|
||||||
|
@ -845,7 +844,7 @@ static struct device *get_dev_from_tx_dma_channel(u32_t dma_channel)
|
||||||
.dma_name = DT_I2S_##index##_DMA_CONTROLLER_##dir_cap, \
|
.dma_name = DT_I2S_##index##_DMA_CONTROLLER_##dir_cap, \
|
||||||
.dma_channel = DT_I2S_##index##_DMA_CHANNEL_##dir_cap, \
|
.dma_channel = DT_I2S_##index##_DMA_CHANNEL_##dir_cap, \
|
||||||
.dma_cfg = { \
|
.dma_cfg = { \
|
||||||
.block_count = 1, \
|
.block_count = 2, \
|
||||||
.dma_slot = DT_I2S_##index##_DMA_SLOT_##dir_cap, \
|
.dma_slot = DT_I2S_##index##_DMA_SLOT_##dir_cap, \
|
||||||
.channel_direction = PERIPHERAL_TO_MEMORY, \
|
.channel_direction = PERIPHERAL_TO_MEMORY, \
|
||||||
.source_data_size = 2, /* 16bit default */ \
|
.source_data_size = 2, /* 16bit default */ \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue