Skip to content

Commit 6ec2525

Browse files
committed
dma: add irq_callback to dma_chan_data
Adds irq_callback to dma_chan_data. It's called by the DMA domain right after receiving an interrupt, so should execute very time-sensitive operations. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
1 parent a1f80af commit 6ec2525

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/include/sof/lib/dma.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ struct dma_chan_data {
222222
/* callback type */
223223
int cb_type;
224224

225+
/* called by the DMA domain right after receiving an interrupt,
226+
* so should execute very time-sensitive operations
227+
*/
228+
void (*irq_callback)(struct dma_chan_data *channel);
229+
225230
void *private;
226231
};
227232

src/schedule/dma_multi_chan_domain.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ static bool dma_multi_chan_domain_is_pending(struct ll_schedule_domain *domain,
250250
if (dma_domain->data[i][j].task != task)
251251
continue;
252252

253+
/* execute callback if exists */
254+
if (dmas[i].chan[j].irq_callback)
255+
dmas[i].chan[j].irq_callback(&dmas[i].chan[j]);
256+
253257
/* clear interrupt */
254258
dma_interrupt(&dmas[i].chan[j], DMA_IRQ_CLEAR);
255259
interrupt_clear_mask(dma_domain->data[i][j].irq,

0 commit comments

Comments
 (0)