Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/audio/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ static struct comp_dev *dai_new(struct sof_ipc_comp *comp)
dd->dai_pos_blks = 0;
dd->xrun = 0;
dd->pointer_init = 0;
dd->chan = DMA_CHAN_INVALID;

dev->state = COMP_STATE_READY;
return dev;
Expand Down Expand Up @@ -747,8 +748,10 @@ static int dai_config(struct comp_dev *dev, struct sof_ipc_dai_config *config)
return -EINVAL;
}

/* channel is ignored by GP dma get function */
dd->chan = dma_channel_get(dd->dma, channel);
if (dd->chan == DMA_CHAN_INVALID)
/* get dma channel at first config only */
dd->chan = dma_channel_get(dd->dma, channel);

if (dd->chan < 0) {
trace_dai_error("dai_config() error: dma_channel_get() failed");
return -EIO;
Expand Down
5 changes: 5 additions & 0 deletions src/audio/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ static struct comp_dev *host_new(struct sof_ipc_comp *comp)
goto error;
#endif

hd->chan = DMA_CHAN_INVALID;

/* init posn data. TODO: other fields */
hd->posn.comp_id = comp->id;
hd->pointer_init = 0;
Expand Down Expand Up @@ -644,6 +646,9 @@ static int host_reset(struct comp_dev *dev)
dma_sg_free(&hd->config.elem_array);
#endif

/* reset dma channel as we have put it */
hd->chan = DMA_CHAN_INVALID;

host_pointer_reset(dev);
hd->pointer_init = 0;
#if !defined CONFIG_DMA_GW
Expand Down
2 changes: 2 additions & 0 deletions src/include/sof/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
#define DMA_RELOAD_END 0
#define DMA_RELOAD_LLI 0xFFFFFFFF

#define DMA_CHAN_INVALID 0xFFFFFFFF

struct dma;

/**
Expand Down