drivers: dma: Apply DMA callback change to relevant drivers

Now the dma device instance is passed as parameter to the callback.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-07-08 21:19:29 +02:00 committed by Carles Cufí
commit 6acee3dcba
19 changed files with 81 additions and 58 deletions

View file

@ -15,8 +15,8 @@ LOG_MODULE_REGISTER(dma_sam0, CONFIG_DMA_LOG_LEVEL);
#define DMA_REGS ((Dmac *)DT_INST_REG_ADDR(0))
typedef void (*dma_callback)(void *callback_arg, uint32_t channel,
int error_code);
typedef void (*dma_callback)(struct device *dev, void *callback_arg,
uint32_t channel, int error_code);
struct dma_sam0_channel {
dma_callback cb;
@ -50,11 +50,12 @@ static void dma_sam0_isr(void *arg)
if (pend & DMAC_INTPEND_TERR) {
if (chdata->cb) {
chdata->cb(chdata->cb_arg, channel, -DMAC_INTPEND_TERR);
chdata->cb(dev, chdata->cb_arg,
channel, -DMAC_INTPEND_TERR);
}
} else if (pend & DMAC_INTPEND_TCMPL) {
if (chdata->cb) {
chdata->cb(chdata->cb_arg, channel, 0);
chdata->cb(dev, chdata->cb_arg, channel, 0);
}
}