From 9f403d683ec80fc292c871594c3765f534daa440 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Wed, 2 Jan 2019 17:33:37 +0800 Subject: [PATCH] host: reset dma channel to invalid by default This will be helpful for error reporting at host dma channel management. Signed-off-by: Keyon Jie --- src/audio/host.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/audio/host.c b/src/audio/host.c index d44ad96d1..317afb652 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -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; @@ -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