Skip to content

Commit 3fb8a94

Browse files
dleach02kartben
authored andcommitted
dma: dma_mcux_lpc: fix scatter/gather src/dst increment
The logic for setting the src_inc and dst_inc would improperly set these to zero when gatter/scatter was enabled but the respective gatther_interval/scatter_interval was zero (which would imply continuous operation). Fixes: #85403 Signed-off-by: David Leach <[email protected]>
1 parent 7e55da5 commit 3fb8a94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/dma/dma_mcux_lpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static int dma_mcux_lpc_configure(const struct device *dev, uint32_t channel,
402402
switch (config->channel_direction) {
403403
case MEMORY_TO_MEMORY:
404404
is_periph = false;
405-
if (block_config->source_gather_en) {
405+
if (block_config->source_gather_en && (block_config->source_gather_interval != 0)) {
406406
src_inc = block_config->source_gather_interval / width;
407407
/* The current controller only supports incrementing the
408408
* source and destination up to 4 time transfer width
@@ -412,7 +412,7 @@ static int dma_mcux_lpc_configure(const struct device *dev, uint32_t channel,
412412
}
413413
}
414414

415-
if (block_config->dest_scatter_en) {
415+
if (block_config->dest_scatter_en && (block_config->dest_scatter_interval != 0)) {
416416
dst_inc = block_config->dest_scatter_interval / width;
417417
/* The current controller only supports incrementing the
418418
* source and destination up to 4 time transfer width

0 commit comments

Comments
 (0)