drivers: dma: sam0: fix DMA to peripheral transfer on SAMD5x

We need to select TRIGACT_BLOCK for DMA to peripheral to work.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
This commit is contained in:
Benjamin Valentin 2019-05-15 17:55:13 +02:00 committed by Kumar Gala
parent 9003d6c3a3
commit 90cc723e65

View file

@ -149,7 +149,7 @@ static int dma_sam0_config(struct device *dev, u32_t channel,
DMAC_CHCTRLA_TRIGSRC(config->dma_slot);
} else {
/* One peripheral trigger per beat */
chcfg->CHCTRLA.reg = DMAC_CHCTRLA_TRIGACT_BURST |
chcfg->CHCTRLA.reg = DMAC_CHCTRLA_TRIGACT_BLOCK |
DMAC_CHCTRLA_TRIGSRC(config->dma_slot);
}
@ -161,22 +161,6 @@ static int dma_sam0_config(struct device *dev, u32_t channel,
chcfg->CHPRILVL.bit.PRILVL = config->channel_priority;
/* Set the burst length */
if (config->source_burst_length != config->dest_burst_length) {
LOG_ERR("Source and destination burst lengths must be equal");
goto inval;
}
if (config->source_burst_length > 16U) {
LOG_ERR("Invalid burst length");
goto inval;
}
if (config->source_burst_length > 0U) {
chcfg->CHCTRLA.reg |= DMAC_CHCTRLA_BURSTLEN(
config->source_burst_length - 1U);
}
/* Enable the interrupts */
chcfg->CHINTENSET.reg = DMAC_CHINTENSET_TCMPL;
if (!config->error_callback_en) {